There's a reason it's called ModuleInvoke
and not FunctionInvoke.  Module invocation was
specifically designed to *not* expose functions
defined in stored modules.  Invoking a module
implicitly runs the body of the module (only
main modules can be invoked, never library modules).

   It's a conceptual mistake to think of XQuery
modules, especially main modules, as similar to
Java or C/C++ libraries.  You don't "invoke"
functions in an XQuery module, you always invoke
a main module.  A main module may import library
modules and call functions in them.

   You should think of functions defined in
library modules as internal implementation
details and main modules as the public interface.
When submitting requests via XCC, you're traversing
a Java/XQuery language boundary.  When doing so,
you should stick to the public interface.  If you
could expose internal library functions to Java,
then you'd have a "leaky abstraction" which is poor
software design.

   When you submit an ad-hoc query, the server
effectively creates a temporary main module on
the fly for you (with your query as its body)
and then invokes it on your behalf.  These
modules are transient and thus are not cached.

   To "invoke" a function in a library, create
a simple main module that imports the appropriate
library module and whose body calls the function
you want (possibly passing external variables).

On Feb 15, 2007, at 8:07 AM, Stewart, Joel (LNG-DAY) wrote:

It looks like the api provides only a way to invoke a module that params are passed via defined external variables. Is there a way to use module invoke objects to call one of several defined methods in an xqy module? How do I specify the params to the method?





Joel Stewart

Sr. Software Engineer

Elsevier Dayton Information Technology

937 865 6800 x54715



_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

---
Ron Hitchens [EMAIL PROTECTED]  650-655-2351




_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to