issuing XQuery via basex command line
Wednesday, 27 February 2013 · 2 messages
SJ
Silver, Jonathan27 Feb 2013 20:42 #
I've just downloaded 7.6 and am trying to perform a query using the command line basex utility, It does not seem to work. I can execute the following using the GUI, but not from the utility,
1. Any ideas? Is this a limitation or a bug? I have not looked through the source code yet.
2. Is there any way to insert comments in the command file that is passed on basex -c filename.xq ?
3. Am I supposed to be able to split the for loop onto multiple lines? It does not appear so.
Thanks,
Jonathan
Open factbook
for $x in /mondial/country where $x/languages="English" return $x/religions
CG
Christian Grün27 Feb 2013 23:28 #
Dear Jonathan,
please take your time and give us some more details on what you did; otherwise, it will be difficult for us to guess what you are fighting with.
Quoted text · Silver, Jonathan · 2 lines
> 1. Any ideas? Is this a limitation or a bug? I have not looked through > the source code yet.
See above ;)
Quoted text · Silver, Jonathan · 2 lines
> 2. Is there any way to insert comments in the command file that is passed > on basex –c filename.xq ?
Yes, lines with # are interpreted as comments and are skipped. By the way, the default extension for BaseX command scripts is .bxs (see [1]).
Quoted text · Silver, Jonathan · 4 lines
> 3. Am I supposed to be able to split the for loop onto multiple lines? It > does not appear so. > Open factbook > for $x in /mondial/country where $x/languages="English" return $x/religions
In order to process this query, you’ll have to add db:open('factbook') before /mondial. You can also specify an initial input via -i (see [2]).
Hope this helps,
Christian
[1] http://docs.basex.org/wiki/Commands#Command_Scripts
[2] http://docs.basex.org/wiki/Startup_Options#BaseX_Standalone
Written for BaseX 7.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery