Hi,
I have used EXPath packaging, often to package some Java code and a calling xquery module [1].
the URL of the expath-pkg.xml library module which will be imported from
outside must match the name of the package In my experience this is not required, see [2] for example. I think the problem may be that only the first xquery referenced in expath-pkg works. I believe your example should work.
One problem I had when trying to use the repository feature for more complex packaging occurs when the package exposes some xqm and that xqm imports a utility library xqm that is in the package, but not exposed in the expath-pkg.xml, and the Xquery that imports the packaged xqm also imports a different version of the utility library. Conflicts can arise between the two versions. They should be isolated [3]
/Andy
[1] https://github.com/expkg-zone58 [2] https://github.com/expkg-zone58/ex-thumbnailator/blob/master/src/main/expath... [3] https://github.com/BaseXdb/basex/issues/2048
On Mon, 24 Jan 2022 at 17:43, Christian Grün christian.gruen@gmail.com wrote:
How best to manage deployment of XQuery modules and top-level scripts
from a source environment to a running remote server so that using scripts can import modules using just the module namespace?
If you don’t care about version conflicts and other potential dependency errors, you could use the following expression (the argument of fetch:binary can be an arbitrary URI):
basex "archive:extract-to(db:option('repopath'), fetch:binary('....zip'))"
I looked quickly at the code for EXPath package processing but I didn’t
spent much time in it, but it probably wouldn’t be too hard to enhance it to behave as I expected. I could possibly pursue that if anyone else would use it.
Thanks for the offer, that would certainly be appreciated.