[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] XPath context evaluation


Subject: Re: [xsl] XPath context evaluation
From: Victor Toni <xsl-list@xxxxxxxxx>
Date: Fri, 12 May 2006 22:30:33 +0200

Michael Kay wrote:
BTW, where would I register my own functions?

There are many ways in Saxon to incorporate your own functions if they are in your own namespace (you'll have to dig around the Javadoc and probably the code to find them though!) - essentially Saxon's XPath parser searches in a set of FunctionLibrary objects, each of which is given the opportunity to grab a function reference and bind it to some implementation; you can add your own FunctionLibrary at various levels of the system either globally in the Configuration or in a particular static context.

To add a function that's in the standard namespace is not really approved of
but I can see why you want to do it (there's a need for this in XForms as
well). At present, though, it requires code change, or at a minumum a change
to the table of functions in the StandardFunctions module.

If you want more help on this, switch to the Saxon list.
Your help is very much appreciated. Thanks a lot.

In the meantime I found a nearly trivial solution which lets my keep my environment:

"subsequence(//info,index-of(//info/id, .), 1)"

These functions were easy to implement and solved the issue I had. Since performance doesn't count for this use case I am glad it works :-)

Victor


Current Thread
Keywords