我想使用 XPath 2.0 函数,如下所示:
http://www.w3schools.com/xpath/xpath_functions.asp
在浏览器中进行 XSL 转换。我可以在样式表标记中将 XSL 版本指定为 2.0,但这似乎并没有激活 2.0 XPath 函数(至少在 Firefox 中)。
例如:
<xsl:value-of select="node-name(//testnode)"/>
给我:
'node-name' is not a valid XSLT or XPath function. -->node-name(//testnode)<--
在 IE 8 中。XPath 1.0 函数:
http://www.edankert.com/xpathfunctions.html
似乎工作正常。根据我的阅读,Chrome 似乎不支持 XSL 2.0。
最佳答案
今天,没有浏览器支持 XPath 2.0
改用name()
。
关于internet-explorer - 让 xpath 2.0 函数在任何浏览器中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3293763/