sorry for my blatant ignorance, I am using RESTXQ over REST so regularly, that I almost forgot about the actual REST-Servlet!
let $tokens := fetch:xml(„relative/to/.basex-home/tokens.xml")//entry
With `fetch:xml` in contrast to `doc()` it should work consistently across all modes of operation (REST, RestXQ, BaseX Standalone).
I am not really sure when the behavior of `doc` in the REST servlet changed, but a commit between 8.5.4 and 8.6 must have introduced this change.
`RESTPATH` is used to define the location of the XQuery files ran via the `?run=`-Parameter, but it does not change the base uri of the static context.
Hope this won’t cause too much trouble with your codebase.
Best
Michael
Hi Michael,
thanks for the information.
I changed
let $tokens := doc("tokens.xml")//entry
to
let $tokens := fetch:xml("tokens.xml")//entry
(tokens.xml is in the same directory as the xq-file.)
The problem is still the same:
[bxerr:BXFE0001] Resource "/Users/User/tokens.xml (No such file or directory)" not found.
The path should be: /Users/User/Documents/project/BaseXWeb/tokens.xml
Same problems with RESTPATH empty or path to project-folder.
As I wrote, I have only problems with the REST-Service, not with RESTXQ.
Best,
Guenter