Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何从BaseX控制台执行XQuery?_Xml_Xpath_Command Line Interface_Xquery_Basex - Fatal编程技术网

Xml 如何从BaseX控制台执行XQuery?

Xml 如何从BaseX控制台执行XQuery?,xml,xpath,command-line-interface,xquery,basex,Xml,Xpath,Command Line Interface,Xquery,Basex,如何在模式下从BaseX运行XQuery 使用BaseX进行简单的读取和查询: thufir@dur:~/basex$ thufir@dur:~/basex$ basex [warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java BaseX 9.0.1 [Standalone] Try 'help' to get more information. > > LIST

如何在模式下从
BaseX
运行
XQuery

使用
BaseX
进行简单的读取和查询:

thufir@dur:~/basex$ 
thufir@dur:~/basex$ basex
[warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
BaseX 9.0.1 [Standalone]
Try 'help' to get more information.
> 
> LIST
Name  Resources  Size  Input Path                        
-------------------------------------------------------
note  1          5208  /home/thufir/basex/note.data.xml  

1 database(s).
> 
> OPEN note
Database 'note' was opened in 65.07 ms.
> 
> XQUERY db:open("note")//note
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
Query executed in 251.29 ms.
> 
> RUN query.note.db.xq
Resource "/home/thufir/query.note.db.xq" not found.
> 
> RUN query.note.xq
Resource "/home/thufir/query.note.xq" not found.
> 
> exit
Have a nice day.
thufir@dur:~/basex$ 
从GUI工作:

路径固定:

thufir@dur:~/basex$ 
thufir@dur:~/basex$ basex
[warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
BaseX 9.0.1 [Standalone]
Try 'help' to get more information.
> 
> RUN basex/query.note.db.xq
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
Query "query.note.db.xq" executed in 472.97 ms.
> 
> exit
Enjoy life.
thufir@dur:~/basex$ 
thufir@dur:~/basex$
thufir@dur:~/basex$basex
[警告]/usr/bin/basex:在/usr/share/java中找不到/usr/share/java/jing.jar
BaseX 9.0.1[独立]
请尝试“帮助”以获取更多信息。
> 
>运行basex/query.note.db.xq
托弗
贾尼
提醒
这个周末别忘了我!
472.97 ms中执行的查询“Query.note.db.xq”。
> 
>出口
享受生活。
thufir@dur:~/basex$
(感谢Christian Gruen确认这是一个路径问题。)

thufir@dur:~/basex$ 
thufir@dur:~/basex$ basex
[warning] /usr/bin/basex: Unable to locate /usr/share/java/jing.jar in /usr/share/java
BaseX 9.0.1 [Standalone]
Try 'help' to get more information.
> 
> RUN basex/query.note.db.xq
<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>
Query "query.note.db.xq" executed in 472.97 ms.
> 
> exit
Enjoy life.
thufir@dur:~/basex$