|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Scope of variable defined in <xsl:choose>
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








