This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

variables and calling templates


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:variable>
    <xsl:if test="@foo='bar'">
      <xsl:call-template="foobar" />
    </xsl:if>
  </xsl:for-each>
</xsl:template>

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

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,
Chris




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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]