views:

46

answers:

2

I want to use XPath 2.0 functions, like these:

http://www.w3schools.com/xpath/xpath_functions.asp

In a browser XSL transform. I can specify the XSL version as 2.0 in the stylesheet tag, but this doesn't seem to activate the 2.0 XPath functions (at least in Firefox).

So for example this:

<xsl:value-of select="node-name(//testnode)"/>

gives me:

'node-name' is not a valid XSLT or XPath function. -->node-name(//testnode)<--

in IE 8. The XPath 1.0 functions:

http://www.edankert.com/xpathfunctions.html

seem to work fine. Chrome doesn't appear to support XSL 2.0 from what I read.

+2  A: 

Today, no browser support XPath 2.0

Use name() instead.

Alejandro
A: 

I don't believe that any browsers support XSLT 2.0.

If you want to have the browser perform the transform, then you are relegated to XSLT 1.0.

However, you may be able to use EXSLT extension functions in certain browsers.

Mads Hansen