BaseX Standalone -i flag may need clarification
Wednesday, 6 June 2012 · 7 messages
CG
Hi Philippe,
good point. As this has been irritating for other users as well, we've finally changed the behavior just some days ago. Feel free to check out the latest snapshot.
Christian
Quoted text · Philippe Rathé · 27 lines
On Wed, Jun 6, 2012 at 2:47 AM, Philippe Rathé <prathe at gmail.com> wrote: > Hello there, > > I'm using the CLI to load a xml file from my file system: > > java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqy > > The first time I run the command, everything is fine, my file is > loaded and my xquery script is executed. > But the second time I run it, whenever I change the content of > myfile.xml, it is not taken in consideration. > I realized that it stores my file in the database the first time and > after that it loads it from the database. > > I was confused because it worked the first time. Could it refresh the > content of the database whenever a file exists? > And fallback to open the file from database when the specified file > does not exist? > > Whatever, maybe just a clarification about the behavior in the doc > could prevent bad usage. > > Thanks. > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Quoted text · Philippe Rathé · 3 lines
> I've just built the version of basex and basex-api from master and it > seems that -b does not work as before. In fact it does not seem to > pass the variable.
Works on my machine (Windows). Do you have Linux? In that case, $ will probably be evaluated by the shell (wondering, though, why it was working before).
Quoted text · Philippe Rathé · 43 lines
> > java -cp target/basex-7.3-SNAPSHOT.jar org.basex.BaseX -b$v=example -q$v > Stopped at line 1, column 1: > [XPST0003] Empty query. > > On Tue, Jun 5, 2012 at 8:49 PM, Christian Grün > <christian.gruen at gmail.com> wrote: >> Hi Philippe, >> >> good point. As this has been irritating for other users as well, we've >> finally changed the behavior just some days ago. Feel free to check >> out the latest snapshot. >> >> Christian >> ___________________________ >> >> On Wed, Jun 6, 2012 at 2:47 AM, Philippe Rathé <prathe at gmail.com> wrote: >>> Hello there, >>> >>> I'm using the CLI to load a xml file from my file system: >>> >>> java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqy >>> >>> The first time I run the command, everything is fine, my file is >>> loaded and my xquery script is executed. >>> But the second time I run it, whenever I change the content of >>> myfile.xml, it is not taken in consideration. >>> I realized that it stores my file in the database the first time and >>> after that it loads it from the database. >>> >>> I was confused because it worked the first time. Could it refresh the >>> content of the database whenever a file exists? >>> And fallback to open the file from database when the specified file >>> does not exist? >>> >>> Whatever, maybe just a clarification about the behavior in the doc >>> could prevent bad usage. >>> >>> Thanks. >>> _______________________________________________ >>> BaseX-Talk mailing list >>> BaseX-Talk at mailman.uni-konstanz.de >>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
PR
Philippe Rathé6 Jun 2012 04:47 #
Hello there,
I'm using the CLI to load a xml file from my file system:
java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqyThe first time I run the command, everything is fine, my file is loaded and my xquery script is executed.
But the second time I run it, whenever I change the content of myfile.xml, it is not taken in consideration.
I realized that it stores my file in the database the first time and after that it loads it from the database.
I was confused because it worked the first time. Could it refresh the content of the database whenever a file exists?
And fallback to open the file from database when the specified file does not exist?
Whatever, maybe just a clarification about the behavior in the doc could prevent bad usage.
Thanks.
PR
Thanks,
the mailing list is quite active, it is promising!
Quoted text · Christian Grün · 38 lines
On Tue, Jun 5, 2012 at 8:49 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Philippe, > > good point. As this has been irritating for other users as well, we've > finally changed the behavior just some days ago. Feel free to check > out the latest snapshot. > > Christian > ___________________________ > > On Wed, Jun 6, 2012 at 2:47 AM, Philippe Rathé <prathe at gmail.com> wrote: >> Hello there, >> >> I'm using the CLI to load a xml file from my file system: >> >> java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqy >> >> The first time I run the command, everything is fine, my file is >> loaded and my xquery script is executed. >> But the second time I run it, whenever I change the content of >> myfile.xml, it is not taken in consideration. >> I realized that it stores my file in the database the first time and >> after that it loads it from the database. >> >> I was confused because it worked the first time. Could it refresh the >> content of the database whenever a file exists? >> And fallback to open the file from database when the specified file >> does not exist? >> >> Whatever, maybe just a clarification about the behavior in the doc >> could prevent bad usage. >> >> Thanks. >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
PR
Does the -b flag changed as well?
I've just built the version of basex and basex-api from master and it seems that -b does not work as before. In fact it does not seem to pass the variable.
java -cp target/basex-7.3-SNAPSHOT.jar org.basex.BaseX -b$v=example -q$v Stopped at line 1, column 1:
[XPST0003] Empty query.
Quoted text · Christian Grün · 38 lines
On Tue, Jun 5, 2012 at 8:49 PM, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Philippe, > > good point. As this has been irritating for other users as well, we've > finally changed the behavior just some days ago. Feel free to check > out the latest snapshot. > > Christian > ___________________________ > > On Wed, Jun 6, 2012 at 2:47 AM, Philippe Rathé <prathe at gmail.com> wrote: >> Hello there, >> >> I'm using the CLI to load a xml file from my file system: >> >> java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqy >> >> The first time I run the command, everything is fine, my file is >> loaded and my xquery script is executed. >> But the second time I run it, whenever I change the content of >> myfile.xml, it is not taken in consideration. >> I realized that it stores my file in the database the first time and >> after that it loads it from the database. >> >> I was confused because it worked the first time. Could it refresh the >> content of the database whenever a file exists? >> And fallback to open the file from database when the specified file >> does not exist? >> >> Whatever, maybe just a clarification about the behavior in the doc >> could prevent bad usage. >> >> Thanks. >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
PR
Ok yes it isn't working because $v is evaluating by my shell (Mac OSX).
I did not chose the right example. I really see an error which I have in 7.3 which I don't have in 7.2.2.
What is failing with 7.3 is when I specified an xquery file, not an inline query:
$BASEX73 $XQUERY_FILE -o $RESPONSE -b\$url=$HOME_URLBut I just tried to put the $XQUERY_FILE at the end of the command, now it works.
$BASEX73 -o $RESPONSE -b\$url=$HOME_URL $XQUERY_FILESo I guess the changes between 7.2.2 and 7.3 is the importance where we specified the file in the command?
Quoted text · Christian Grün · 54 lines
On Tue, Jun 5, 2012 at 9:23 PM, Christian Grün <christian.gruen at gmail.com> wrote: >> I've just built the version of basex and basex-api from master and it >> seems that -b does not work as before. In fact it does not seem to >> pass the variable. > > Works on my machine (Windows). Do you have Linux? In that case, $ will > probably be evaluated by the shell (wondering, though, why it was > working before). > > >> >> java -cp target/basex-7.3-SNAPSHOT.jar org.basex.BaseX -b$v=example -q$v >> Stopped at line 1, column 1: >> [XPST0003] Empty query. >> >> On Tue, Jun 5, 2012 at 8:49 PM, Christian Grün >> <christian.gruen at gmail.com> wrote: >>> Hi Philippe, >>> >>> good point. As this has been irritating for other users as well, we've >>> finally changed the behavior just some days ago. Feel free to check >>> out the latest snapshot. >>> >>> Christian >>> ___________________________ >>> >>> On Wed, Jun 6, 2012 at 2:47 AM, Philippe Rathé <prathe at gmail.com> wrote: >>>> Hello there, >>>> >>>> I'm using the CLI to load a xml file from my file system: >>>> >>>> java -cp basex.jar org.basex.BaseX -i myfile.xml myscript.xqy >>>> >>>> The first time I run the command, everything is fine, my file is >>>> loaded and my xquery script is executed. >>>> But the second time I run it, whenever I change the content of >>>> myfile.xml, it is not taken in consideration. >>>> I realized that it stores my file in the database the first time and >>>> after that it loads it from the database. >>>> >>>> I was confused because it worked the first time. Could it refresh the >>>> content of the database whenever a file exists? >>>> And fallback to open the file from database when the specified file >>>> does not exist? >>>> >>>> Whatever, maybe just a clarification about the behavior in the doc >>>> could prevent bad usage. >>>> >>>> Thanks. >>>> _______________________________________________ >>>> BaseX-Talk mailing list >>>> BaseX-Talk at mailman.uni-konstanz.de >>>> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
CG
Christian Grün6 Jun 2012 12:22 #
Quoted text · Philippe Rathé · 4 lines
> $BASEX73 -o $RESPONSE -b\$url=$HOME_URL $XQUERY_FILE > > So I guess the changes between 7.2.2 and 7.3 is the importance where > we specified the file in the command?
Exactly; with BaseX 7.3, all options are evaluated in the given order [1]. Christian
[1] http://docs.basex.org/wiki/Startup_Options
Written for BaseX 7.2. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery