New feature : extensions functions in Xpath (not only xslt)
Sylvain Spinelli <[email protected]> Thu, 18 Dec 2008 02:09:16 -0800 (PST)
| Newsgroups | gmane.comp.mozilla.devel.layout.xslt |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <aab9d6de-b0b6-4bfe-b282-4f4a5c2ac251@a37g2000pre.googlegroups.com> |
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 ?