how do I specify a database for a .xq file to use?
a simple FLOWR:
thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java <title lang="en">Learning XML</title> <title lang="en">XQuery Kick Start</title>thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ cat titles.xq for $x in doc("books.xml")/bookstore/book where $x/price>30 order by $x/title return $x/title thufir@dur:~/basex/w3$
(from w3schools)
thanks,
Thufir
From SO (and the fine manual), the solution is to use: basex -i w3school_data titles.xq
Very interesting. I'm sure this can be piped or simply written to a file, but is there a particularly "basex" method? Not to just return a result but write that result back to basex.
thanks,
Thufir
On 2019-10-06 11:53 p.m., thufir wrote:
how do I specify a database for a .xq file to use?
a simple FLOWR:
thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
<title lang="en">Learning XML</title> <title lang="en">XQuery Kick Start</title>thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ cat titles.xq for $x in doc("books.xml")/bookstore/book where $x/price>30 order by $x/title return $x/title thufir@dur:~/basex/w3$
(from w3schools)
thanks,
Thufir
Not to just return a result but write that result back to basex.
Sure! See here [1] (more specifically, [2]).
thanks,
Welcome.
[1] http://docs.basex.org/ [2] http://docs.basex.org/wiki/Command-Line_Options#Standalone
On 2019-10-06 11:53 p.m., thufir wrote:
how do I specify a database for a .xq file to use?
a simple FLOWR:
thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ basex titles.xq [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
<title lang="en">Learning XML</title> <title lang="en">XQuery Kick Start</title>thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ thufir@dur:~/basex/w3$ cat titles.xq for $x in doc("books.xml")/bookstore/book where $x/price>30 order by $x/title return $x/title thufir@dur:~/basex/w3$
(from w3schools)
thanks,
Thufir
On Mon, 2019-10-07 at 03:38 -0700, thufir wrote:
From SO (and the fine manual), the solution is to use: basex -i w3school_data titles.xq
Seeing the filename propts me to note - w3schools (when i've looked at it) isn't a good place to learn from. They were never affiliated with W3C, and their tutorials often seem written by people without a deep understanding.
Mind you, i don't know many free online resources that are better alternatives...
They were never affiliated with W3C, […]
Thanks for the info, Liam! I have added a little comment.
Links to helpful resources are always welcome.
On Mon, Oct 7, 2019 at 5:39 PM Liam R. E. Quin liam@fromoldbooks.org wrote:
On Mon, 2019-10-07 at 03:38 -0700, thufir wrote:
From SO (and the fine manual), the solution is to use: basex -i w3school_data titles.xq
Seeing the filename propts me to note - w3schools (when i've looked at it) isn't a good place to learn from. They were never affiliated with W3C, and their tutorials often seem written by people without a deep understanding.
Mind you, i don't know many free online resources that are better alternatives...
-- Liam Quin, https://www.delightfulcomputing.com/ Available for XML/Document/Information Architecture/XSLT/ XSL/XQuery/Web/Text Processing/A11Y training, work & consulting. Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
basex-talk@mailman.uni-konstanz.de