qexo-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] How to specify input files at runtime?


From: Per Bothner
Subject: Re: [Qexo-general] How to specify input files at runtime?
Date: Tue, 27 Sep 2005 08:28:26 -0700
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

[Sorry I didn't see this in the input queue among all the spam,
until now.]

daniel mahler wrote:
How can I specify input files at run time,
ie. do somehing like

$ java kawa.repl --xquery script.xql file.xml

or

$ java kawa.repl --xquery script.xql < file.xml

All XQuery examples I've seen hardcode the input file in the script.
Surely this is not what people actually do.
Generating the xquery dynamically just for this looks like massive
overkill.

You can use an external variable to specify a filename/URL.
Thus in script.xql:

declare variable $input external;
doc($input)

Then invoke it thus:

java kawa.repl --xquery input=file.xml script.xql

You need a fairly recent version of Qexo (I suggest the just-announced
release candidate of 1.8) to be able to use extenal variables.
--
        --Per Bothner
address@hidden   http://per.bothner.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]