... am I missing something?
So this
db:node-id($node)
should raise an error in case $node is not a database node. However in the GUI and in the command-line client.
db:node-id(doc('F:/tmp/afile.xml')) => 0 db:node-id(doc('F:/tmp/afile.xml')/*) => 1
only requirement is that 'F:/tmp/afile.xml' exists as a file. Even with no database open or existing and never having imported this file.
It doesn't depend on the format of the path and same result with 'F:\tmp\afile.xml', 'file:///F:/tmp/afile.xml'.
--Marc
On Tue, Jan 10, 2017 at 3:17 PM, Marc van Grootel marc.van.grootel@gmail.com wrote:
Hi all,
Happy new year btw!
I got bitten by something and can't explain this behaviour.
So the situation is that I have an XML file on the file system in F:/tmp/foo.xml
I also have this file imported into a database named "foo" (and the path "/foo.xml".
Now in the GUI (and on 8.5.3) I have the following.
When I have the database closed in the GUI
base-uri(doc('F:/tmp/foo.xml')) => file:///F:/tmp/foo.xml
And when I open the database "foo" from the GUI
base-uri(doc('F:/tmp/foo.xml')) => /foo/foo.xml
Is that right? Also db:* functions also get a database node from the latter and return a node-id for example.
When the foo.xml is moved to another filesystem directory then this doesn't happen so it appears as if this happens only when I try to read the file from the original import location.
Shouldn't these two situations have the same result?
Cheers, --Marc