I am not clear on how to write XPath functions
(in Java, not in XSLT) that depend on the dynamic
context in Saxon. I have successfully implemented
a number of node-related functions that are specific
to my app but because the context node has to be
passed in, the expressions end up looking like:
rather than the more readable:
Does Saxon 8.x support passing the dynamic context
into a user function? I know that the saxon: exten-
sion functions must have that capability but are
there hooks in userland? If so, is there an example
somewhere on the list archive or elsewhere?
It would be great if it could be done in 8.1.1 since
I'm using XmlBeans but I can partition into multiple
deployment units if I have to.
From: Michael Kay <mike@sa...> - 2005-10-30 08:58:17
> Good evening-
> I am not clear on how to write XPath functions
> (in Java, not in XSLT) that depend on the dynamic
> context in Saxon.
Declare an additional first argument of type XPathContext. This argument
will be supplied automatically by Saxon, it doesn't need to be supplied by
the caller. See the code in net.sf.saxon.functions.Extensions for examples.
The mechanism is documented in