Hi,
I try to import a module dynamically, as in this example from a earlier discussion:
let $s:='import module namespace p="xquery-30" at "../repotest/test.xqm"; p:parse-XQuery("2+2")' return xquery:eval($s)
It gives me the following error:
. . . [XQST0059] Could not retrieve module '/home/repotest/test.xqm'.
I run BaseX 8.3 as war in Tomcat container.
If the module is imported in static way:
import module namespace p = "xquery-30 " at "../repotest/test.xqm";
everything works correctly.
From where does the problem with malformed relative path, what solution could be found?
Thanks, Ioan
Hi Ioan,
you can try static-base-uri() in order to find out where your file will be located in the Tomcat environment.
Besides that, it may be recommendable to move your library module to the repository. This way, there will be no need to specify a module location.
Hope this helps Christian
On Tue, Mar 1, 2016 at 6:27 PM, Ioan Fericel mirabit@gmail.com wrote:
Hi,
I try to import a module dynamically, as in this example from a earlier discussion:
let $s:='import module namespace p="xquery-30" at "../repotest/test.xqm";
p:parse-XQuery("2+2")' return xquery:eval($s)
It gives me the following error:
. . . [XQST0059] Could not retrieve module '/home/repotest/test.xqm'.
I run BaseX 8.3 as war in Tomcat container.
If the module is imported in static way:
import module namespace p = "xquery-30 " at "../repotest/test.xqm";
everything works correctly.
From where does the problem with malformed relative path, what solution could be found?
Thanks, Ioan
Thanks Christian,
The problem was solved for now processing the relative path before calling eval function.
Placing modules in one single repo (RESTXQPATH), defined in the web.xml of BaseX, unfortunately is not an option in this case, because there will be more small separate applications and each has its module library included.
Regards, Ioan
basex-talk@mailman.uni-konstanz.de