W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 2000

Variables and Parameters within Templates

From: TOM <ptittom@free.fr>
Date: Mon, 20 Nov 2000 18:38:51 +0100
To: xsl-editors@w3.org
Message-ID: <20001120183851.A1021@debian>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:51 GMT