James A. Robinson wrote:
The kicker is, I'd like very much to be able to use either evaluator
module, the 'basic' one or the MarkLogic one, based on which environment
I'm in.  Is the only way I can see to do this is to have main modules
which statically declare an import for one or the other.  Is there a
dynamic way to resolve which file I want to import?

If XQuery were in XML like XSLT I'd just write a stylesheet to process the
import directives as needed for export into the non-MarkLogic environment!

Hi Jim,

I'll attempt to answer this particular question, since it's a fairly generic question, and you can let me know if it helps in your particular case.

The best way I've found to dynamically choose between ImplA and ImplB XQuery behaviors is to use xdmp:invoke().

http://developer.marklogic.com/pubs/3.1/apidocs/Extension.html#invoke

This call lets you execute a main module specified by a string with any number of variables as well as some runtime options. You can dynamically select the string module name to pass based on context.

If you need something in pure XQuery, there's nothing I can think of.

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

Reply via email to