Как мне запустить XQuery
из BaseX
в автономном режиме?
Используя 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$
запросы, сохраненные как XQuery
файлы:
thufir@dur:~/basex$
thufir@dur:~/basex$ cat query.note.db.xq
db:open("note")//note
thufir@dur:~/basex$
thufir@dur:~/basex$ cat query.note.xq
//note
thufir@dur:~/basex$
thufir@dur:~/basex$ pwd
/home/thufir/basex
thufir@dur:~/basex$
Работает отлично из графического интерфейса пользователя: