We always use custom URIResolver when working with classpath resources afaik.

Similar mechanism might be better than original feature for reasons you stated (duplicity in classpath). You can solve this by choosing correct classloader in *URIResolver.

I've been digging a little into BaseX source and I've found org.basex.io. IO.get method, which does similar thing (loading resource based on string).
If this factory method replaces by a customizable factory with default implementation, that might solve the problem.
However I know very little about BaseX, and I may be completely wrong here.

Karel

On 09/04/2015 16:47, Christian Grün wrote:
Thanks for the links. If I get it right, you need to explicitly call
the URI resolver setter functions to get it working? Or does it mean
that modules will automatically be available via "import module" if
they are in the Java classpath (which is, if I got it right, the
feature you asked for)?



On Thu, Apr 9, 2015 at 5:02 PM, Karel Hovorka
<Karel.Hovorka@semantico.com> wrote:
Exactly, I am refering to "import module".
In my experience with xml-related technologies and java, library usually
supports customizable class for import resource lookup based on namespaces,
paths etc, I can recall 2 examples:


Saxon has class ModuleURIResolver that does just this:
http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/s9api/XQueryCompiler.html#setModuleURIResolver%28net.sf.saxon.lib.ModuleURIResolver%29

Similar class URIResolver and mechanism is in java core for
xsl:import/xsl:include lookup:
http://docs.oracle.com/javase/7/docs/api/javax/xml/transform/TransformerFactory.html#setURIResolver%28javax.xml.transform.URIResolver%29

Thanks,
Karel


On 09/04/2015 15:41, Christian Grün wrote:
I would like to load xquery files that are on classpath of my java
application, not only filesystem.
Does this mean, it is not possible with BaseX?
Do you refer to the "import module" when talking about loading xquery
files?

The classpath is not considered when importing modules. As multiple
directories can be specified in the classpath, it could even happen
that different modules would be import candidates, so we'd need
additional precedence rules. -- Is this possibly supported by any
other query processor you have tried?

Best,
Christian


Karel


On 08/04/2015 18:01, Christian Grün wrote:
Hi Karel,

In BaseX, modules either need to be located in the module repository,
or the relative path needs to be specified in the import module
statement. Some more information on locating modules can be found in
our Wiki [1].

Hope this helps,
Christian

[1] http://docs.basex.org/wiki/Repository



On Wed, Apr 8, 2015 at 5:56 PM, Karel Hovorka
<Karel.Hovorka@semantico.com> wrote:
Hi,

I am trying to run xquery file on basex, but it depends on xquery
module
located in classpath. I have found parameter "org.basex.QUERYPATH",
that
configures module lookup on filesystem. Is there way to lookup modules
in
classpath?

Thanks,

Karel Hovorka, Semantico LTD