I'm looking to adapt the simplest possible FLWOR
possible from BaseX
to eXist
as below.
Error in eXist
:
XML Parsing Error: no root element found
Location: http://localhost:8080/exist/rest/db/scripts/notes.xq
Line Number 1, Column 1:
Query:
xquery version "3.0";
for $note in collection("/db/temp/notes")
return $note
Collection:
<notes>
<note>
foo
</note>
<note>
bar
</note>
<note>
baz
</note>
</notes>
from BaseX
:
nicholas@mordor:~/basex$
nicholas@mordor:~/basex$ cat notes.xq
xquery version "3.1";
for $note in db:open("notes")
return $note
nicholas@mordor:~/basex$
nicholas@mordor:~/basex$ basex notes.xq
[warning] /usr/bin/basex: Unable to locate /usr/share/java/tagsoup.jar in /usr/share/java
[warning] /usr/bin/basex: Unable to locate /usr/share/java/xml-resolver.jar in /usr/share/java
[warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
<notes>
<note>foo</note>
<note>bar</note>
<note>baz</note>
</notes>nicholas@mordor:~/basex$
nicholas@mordor:~/basex$
not sure how to adapt that to eXist
as above.
Minor point being that this is 3.0
and eXist
is using 3.1
, otherwise I'd expect it to be portable. So, must be making some syntax or configuration error?
Not sure how to use a "console" in eXist
so from eXide
:
and
this query:
xquery version "3.0";
for $notes in collection('/db/temp')
return $notes
returns a blank page. The data is in a "file" named notes.xml
in /db/tmp
as above.
I added an xml declaration of:
<?xml version="1.0" encoding="UTF-8" ?>
as well, to the data xml
document.