[xquery-talk] Library Modules and URIs

McBeath, Darin W. (ELS) D.McBeath at elsevier.com
Thu Sep 18 02:47:38 PDT 2003


I was curious how everyone is using the URI field (string literal) to define
a library module within xquery.  I have been considering the following
approach (within Java) and would like some opinions from this group on the
approach.

The approach centers around using a Java packaging scheme style as the URI
for a library module.  For example, I could place a group of utility
functions within a library module with a URI of
"com.elsevier.xquery.functions.util".  The XQuery engine would conceivably
either directly map this URI to the physical location of the library module
(would not require the "at location" when importing the module) or else it
would provide a base path for the location of library modules (via some form
of configuration option) and would require the "at location" when importing
the module.  If the latter approach is used, the URI described above could
easily become the path (by replacing the '.' with '/') appending to the base
path for locating the library module.

One could then easily author a 'wrapper' object which accepts the  URI for
the library module contianing the needed function, function name, and array
of parms to then invoke the function.  This nicely separates the XQuery code
from the Java code.  This also allows a Java style of packaging for XQuery
functions.

In any case, I would be curious to anyones thoughts on this approach.


More information about the talk mailing list