[xslt] Variable scope in for-each



Hi,

while trying to port an application from Linux to Windows (using libxml 10019 and libxslt 20423 on both machines), I got a "redefining name" error on Windows. We're using something like the following quite often:

<xsl:for-each select="./someNode">
 <xsl:variable name="id" select="./elem[ id]"/>
 ...
</xsl:for-each>

After looking into the specs I'm not quite sure how to interpret the section on variables in conjunction with for-each. It's clear that a variable binding is visible for the following siblings and its descendants. But how to interprete that inside for-each elements? Is the for-each loop re-entered for every node letting the binding become invisible or not? Thus, is the above construct correct XSLT or not?

-Claus

--

Claus Augusti
Online-Produktion
Tel: [+49] 0721.91374-172
claus augusti 1und1 com



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