Hello,
Normally (few basex-versions ago) I did:
session.execute("open main"); session.execute("xquery doc("users.xml")//users");
But now, this results in basex interpreting the doc()-path as relative to it's home-directory thus cannot find the resource..
"xquery doc("main/users.xml")//users" gives the correct results.
Do we no longer open a database but writing the full path of the document instead?
Whats the performance of this if accessing multiple documents of the same database during runtime?
-regards,
jan
Hi Jan,
In terms of performance, it’s advisable to open the database in advance if you run several commands on it. Otherwise, you can simply address it via XQuery.
If you use fn:doc, the first path segment of the function argument must be the name of your database [1]. db:open will be the safer option, because there won’t be any attempt to find a non-retrievable resource on the local filesystem.
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Databases#XML_Documents
On Mon, Oct 1, 2018 at 12:41 AM Jan Stapel janstapel00@hotmail.com wrote:
Hello,
Normally (few basex-versions ago) I did:
session.execute("open main"); session.execute("xquery doc("users.xml")//users");
But now, this results in basex interpreting the doc()-path as relative to it's home-directory thus cannot find the resource..
"xquery doc("main/users.xml")//users" gives the correct results.
Do we no longer open a database but writing the full path of the document instead?
Whats the performance of this if accessing multiple documents of the same database during runtime?
-regards,
jan
basex-talk@mailman.uni-konstanz.de