[xslt] Bug in xsl:variable ?



 I think there's a bug in libxsl variable. According to the spec, §11.5,
you can't bind two variables with the same name in a given template
if the the second shadows the first. The first binding beeing visible
from
all following siblings and their descendants, the styleshhet is
incorrect :

<?xml version='1.0' encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" version="1.0"/>

<xsl:template match="/">
<root>
 <xsl:variable name="foo">foo1</xsl:variable>
 <xsl:for-each select="//*">
    <xsl:message>In for-each</xsl:message>
    <xsl:variable name="foo">foo2</xsl:variable>
 </xsl:for-each>
</root>
</xsl:template>

</xsl:stylesheet>

 However saxon chokes on it, but not libxslt.

 Hope this helps,

	Fabrice          
-- 
Fabrice Desré - France Telecom R&D/DMI/GRI
Tel: +(33) 2 96 05 31 43
Fax: +(33) 2 96 05 32 86




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]