Variables and Parameters within Templates

Hi,
the Rec isn't very clear about what is a "template".
In 11.5 :
  "It is an erreor if a binding established by an xsl:variable or
   xsl:param element within a template shadows another binding
   established by an xsl:variable or xsl:param also within the
   template. It is not an erreor if a binding established by an
   xsl:variable or xsl:param element in a template shadows another
   binding established by an xsl:variable or xsl:param top-level
   element."
My question is : what about variables and params in, for example,
xsl:for-each?

For example, is the following allowed ?
<xsl:template match="foo">
  <xsl:variable name="myVar" select="position()"/>
  foo : <xsl:value-of select="$myVar"/>

  <xsl:for-each select="bar">
    <xsl:variable name="myVar" select="position()"/>
    bar : <xsl:value-of select="$myVar"/>
  </xsl:for-each>
</xsl:template>

I'm developping the XSLT implementation of the libxml of Daniel Veillard
and it could totally change the way we'll handle variables.

Thanks in advance.

Tom.

Received on Monday, 20 November 2000 12:39:05 UTC