[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[xsl] Scope of variable defined in
[xsl] Scope of variable defined in
Subject: [xsl] Scope of variable defined in <xsl:choose> From: "Tim Watts" <timw@xxxxxxx> Date: Mon, 21 May 2001 12:21:36 +1000 |
Hi, I can't understand this error message > Error [code:222] [node: > element '<xsl:value-of>'] > variable not found > search/search - text/html for the following code: > <xsl:choose> > <xsl:when test="data/merchant/customer"> > <xsl:variable name="numberdisplayed"><xsl:value-of select="count(data/merchant/customer)" /></xsl:variable> > </xsl:when> > <xsl:otherwise> > <xsl:variable name="numberdisplayed"><xsl:value-of select="count(data/merchant/orders)" /></xsl:variable> > </xsl:otherwise> > </xsl:choose> > <xsl:value-of select="$numberdisplayed" /> The variable has just been defined, but it can't be used outside of the <xsl:choose> Yet, if I have > <xsl:choose> > <xsl:when test="/document/data/merchant/customer"> > <xsl:variable name="numberdisplayed"><xsl:value-of select="count(/document/data/merchant/customer)" /> > </xsl:variable> > <xsl:value-of select="$numberdisplayed" /> > </xsl:when> > <xsl:otherwise> > <xsl:variable name="numberdisplayed"><xsl:value-of select="count(/document/data/merchant/orders)" /> > </xsl:variable> > <xsl:value-of select="$numberdisplayed" /> > </xsl:otherwise> > </xsl:choose> the output is displayed. How can the variable be used throughout the scope of the template it has been defined in? Thanks, Tim Watts PS. Am using Sablotron 0.51. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] ie5 default stylesheet, Nate Austin | Thread | Re: [xsl] Scope of variable defined, Mike Brown |
Re: [xsl] ie5 default stylesheet, Mike Brown | Date | RE: [xsl] Scope of variable defined, Joshua . Kuswadi |
Month |