I've run into what might be a variation of the same problem.
Inside an expath packaged module, a .xqm file uses relative file path references to .xsl files contained within the module. In my case, the relative file path references are being used with xslt:transform(). The path resolution might be exhibiting the same problem that you encountered with xquery:invoke().
With BaseX 8.2.3, using a relative file path inside a module worked. With BaseX 8.5.3 the same module gives an error "Resource ... does not exist."
By adding file:base-dir() to resolve the path helps, and seems to work in both versions 8.2.3 and 8.5.3.
Marco, if you change:
xquery:invoke("src2/q2.xqm")
to this:
xquery:invoke(file:base-dir() || "src2/q2.xqm")
Does this solve the "Resource ... does not exist." problem for you?
Vincent
-----Original Message----- From: basex-talk-bounces@mailman.uni-konstanz.de [mailto:basex-talk-bounces@mailman.uni-konstanz.de] On Behalf Of Marco Lettere Sent: Wednesday, August 31, 2016 12:53 PM To: BaseX basex-talk@mailman.uni-konstanz.de Subject: [basex-talk] 8.5.3 and xquery:invoke ...
Hello again, at the end I managed to reproduce the issue we are currently facing with xquery:invoke in 8.5.3 (and also in latest snapshot).
Please consider the three queries [1,2,3]. The store [2] into a subdirectory src of the directory containing [1] and store [3] into a directory src2 of src. You should get the error message [4]. If instead you change the parameter of xquery:invoke to "src/src2/q2.xqm" it works. Seems like the reference for static-base-uri in [2] remains the one of [1] even if it is reported by static-base-uri() to be correctly "/home/user/src/q1.xqm"(I've double-checked this). Sorry it's not clear to me whether this is meant to be the correct behaviour ... Thanks for any help, Marco.
[1] q.xqm import module namespace q1="urn:q1" at "src/q1.xqm";
q1:f()
[2] q1.xqm module namespace q1 = "urn:q1";
declare function q1:f(){ xquery:invoke("src2/q2.xqm") };
[3] q2.xqm 1 = 1
[4] Stopped at /home/user/src/q1.xqm, 4/16: [FODC0002] Resource 'src2/q2.xqm' does not exist.