我正在寻找最简单的FLWOR
可能BaseX
,eXist
如下所示。
错误eXist
:
XML Parsing Error: no root element found
Location: http://localhost:8080/exist/rest/db/scripts/notes.xq
Line Number 1, Column 1:
询问:
xquery version "3.0";
for $note in collection("/db/temp/notes")
return $note
收藏:
<notes>
<note>
foo
</note>
<note>
bar
</note>
<note>
baz
</note>
</notes>
来自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$
不知道如何适应eXist
上述情况。
次要的一点是这是3.0
并且eXist
正在使用3.1
,否则我希望它是可移植的。那么,一定是在犯一些语法或配置错误吗?
不知道如何在中使用“控制台eXist
” eXide
:
和
这个查询:
xquery version "3.0";
for $notes in collection('/db/temp')
return $notes
返回一个空白页。notes.xml
数据位于上述命名的“文件”中/db/tmp
。
我添加了一个 xml 声明:
<?xml version="1.0" encoding="UTF-8" ?>
以及数据xml
文档。