Duplicate variable in the xslt
Replies (1)
Please register to reply
Added by Anonymous over 16 years ago
Legacy ID: #4877210 Legacy Poster: Vladimir Nesterovsky (vnesterovsky)
Am I missing something or is it a bug that the following code works in saxon 9? <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:template match="/"> <xsl:variable name="x" as="node()" select="."/> <xsl:variable name="x" as="node()" select=""/> <xsl:sequence select="$x"/> </xsl:template> </xsl:stylesheet>
Legacy ID: #4877346 Legacy Poster: Michael Kay (mhkay)
No, the specification explicitly allows this. Seach the spec for Misuse of Variable Shadowing I personally would have preferred it to be an error, but it wasn't my decision. Michael Kay http://www.saxonica.com/
Please register to reply