I have multiple XML files in a BaseX database:
Is there a XQuery or BaseX function to get the file name? In the example above i wanted an other query that returns DB03.xml as output.
I have multiple XML files in a BaseX database:
Is there a XQuery or BaseX function to get the file name? In the example above i wanted an other query that returns DB03.xml as output.
Did you try URIs functions ? http://www.xqueryfunctions.com/xq/c0023.html#c0056
For example :
base-uri(//ITEM[@name="A"])
In cases where base-uri(//ITEM[@name="A"])
would throw error [XQST0046] URI 'path/to/file' is invalid better use db:path(//ITEM[@name="A"])
with no such error, see: https://stackoverflow.com/a/44702662.