This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: XSL variable...
- To: xsl-list at mulberrytech dot com
- Subject: Re: XSL variable...
- From: Mike Brown <mike at skew dot org>
- Date: Wed, 21 Jun 2000 10:00:45 -0600 (MDT)
- Reply-To: xsl-list at mulberrytech dot com
> in one template I wrote
> <xsl:variable name="wasLeft" select="'0'"/>
>
> In other one
> <xsl:variable name="wasLeft" select="'1'"/>
>
> And further to test, with something like this :
> <xsl:when test="$wasLeft='1'">
> <!-- Doing something here -->
> </xsl:when>
>
> If anyone had a suggestion. Any help welcome.
You didn't say what the problem was! Also, what XSL processor are you
using?
I can tell you that variables have scope only from where they are declared
and "below" in the tree. If you declare a variable in a template, it only
has scope in that template, from the place where it was declared on down,
but not outside of the element that contains the <xsl:variable .../>.
I can also say that xsl:when must be contained within an xsl:choose.
- Mike
____________________________________________________________________
Mike J. Brown, software engineer at My XML/XSL resources:
webb.net in Denver, Colorado, USA http://www.skew.org/xml/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list