XPath 1.0 compatibility with saxon:evaluate
Added by Anonymous almost 17 years ago
Legacy ID: #4661114 Legacy Poster: Chuck Morris (morrich)
I have some old XPath 1.0 expressions that I would like to evaluate using Saxon. They work fine in a static context if I set the version attribute to "1.0" on the xsl:stylesheet element to turn on XPath 1.0 compatibility mode. However, if I try to evaluate them dynamically using saxon:evaluate, I find saxon does not use XPath 1.0 compatibility mode. Is there any way to turn compatibility mode on for expressions that are evaluated dynamically using saxon:evaluate? Here's some sample code illustrating the problem. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://saxon.sf.net/" > <xsl:variable name="items"> <item>1</item> <item>2</item> </xsl:variable> <xsl:template match="/"> <xsl:for-each select="$items"> <!-- works --> <xsl:value-of select="string(item)"/> <!-- doesn't work --> <xsl:variable name="expression">string(item)</xsl:variable> <xsl:value-of select="saxon:evaluate($expression)"/> </xsl:for-each> </xsl:template> </xsl:stylesheet>
Replies (1)
RE: XPath 1.0 compatibility with saxon:evalua - Added by Anonymous almost 17 years ago
Legacy ID: #4661710 Legacy Poster: Michael Kay (mhkay)
No, I'm sorry, there's no way to do this currently. Michael Kay Saxonica
Please register to reply