[xsl] variables and calling templates

Subject: [xsl] variables and calling templates
From: "Chris d'Aquin" <CDAquin@xxxxxxxxxxx>
Date: Tue, 2 Oct 2001 18:06:57 -0500
I have a script that looks similar to this:

<xsl:template match="/">
  <xsl:for-each select="//*[@foo]">
    <xsl:variable name="element">
      <xsl:value-of select="name()" />
    <xsl:if test="@foo='bar'">
      <xsl:call-template="foobar" />

<xsl:template name="foobar">
  . . . various statements here that use the $element variable set above .
. .

When I run this using XT, it gives me an error message stating "variable
'element' not defined".  From what I can tell, the $element isn't being
passed from the top portion of the script to the "foobar" template.  What
is the scope of the $element I created, and how can I use the $element in
the "foobar" template?

Thanks in advance,

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread