Re: New feature : extensions functions in Xpath (not only xslt)

Jonas Sicking <[email protected]> Thu, 18 Dec 2008 17:51:24 -0800
Newsgroups gmane.comp.mozilla.devel.layout.xslt
Message-ID <[email protected]>
Sylvain Spinelli wrote:
> Hi,
> 
> Since extension-element-prefixes="..." is not needed in the stylesheet
> root element for using xpath extensions functions in a xslt, it should
> be a very nice feature to make available extensions functions in Xpath
> compiler too.
> 
> Simple example that should work :
> 
> var vResolver = {
>   lookupNamespaceURI : function(pPrefix) {
>     if(pPrefix=="regexp") return "http://exslt.org/regular-
> expressions";
>     return null;
>   }
> }
> var vXpath = document.createExpression("regexp:replace('test', 't',
> 'g', 'X')", vResolver);
> 
> What do you think ?

Indeed, it would be great to make exslt functions available to DOM-XPath 
as well. The only reason that hasn't happened has been lack of time.

/ Jonas