Thanks Christian,
I think I managed to make it work, if I'm not missing anything. The problem was (the last time I tried it, over a year ago), that I need to work with relative paths, and location uris would not work properly. I managed to set it up today, by using a QueryProcessor constructor that includes a base-uri parameter.
The problem is, that when you call the QueryProcessor [1] the base URI should be set to a fake uri or file path, for example "/home/user/application/queries/fake". This way, both location URIs (import module declarations), and document requests to relative urls - doc(concat("../myxml.xml")) work. If base URI is just set as "/home/user/application/queries" - which I thought it would be correct - then only doc() function will look at the correct base-uri directory, while the import module statements, will try to import files from the parent of the base directory. I think it has something to do with how baseURI function works in StaticContext.java [2], but I'm not sure.
Maybe a Java example showing the correct usage of the base-uri, or a wiki page will help others in the future.
[1]: https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/or...
[2]: https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba...
I'm happy I got this out of the way, my next email will be about some issues I found with parallel xquery processing :)
Regards,
George
On 1/23/19 3:04 PM, Christian GrĂ¼n wrote:
Hi George,
Sorry, we have no plans to reintroduce the old option (to much has changed in our architecture). Maybe there are other solutions for your use case in the latest version?
Best Christian