This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: xsl:if @attribute + xsl:variable not working
- From: TSchutzerWeissmann at uk dot imshealth dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 28 Nov 2001 09:33:00 -0000
- Subject: RE: [xsl] xsl:if @attribute + xsl:variable not working
- Reply-to: xsl-list at lists dot mulberrytech dot com
Aniceto,
Have you tried doing a search in your code for "colortabla"? Your variable
is called "color" anyway, it could be a typo.
Tom SW
-----Original Message-----
From: Aniceto Lopez [mailto:aniceto@overthenet.tv]
Sent: 28 November 2001 08:07
To: xsl-list@lists.mulberrytech.com
Subject: [xsl] xsl:if @attribute + xsl:variable not working
Hi all:
why if
<xsl:for-each select="area">
<xsl:if test="@position = 1">
<xsl:variable name="color" select="'#FFF7A0'"/>
</xsl:if>
<xsl:if test="@position = 2">
<xsl:variable name="color" select="'#FF980F"/>
</xsl:if>
<td bgcolor="{$color}">dadada asda</td>
</xsl:for-each>
I get this?
"A reference to variable or parameter 'colortabla' cannot be resolved.
The variable or parameter may not be defined, or it may not be in scope."
-> the variable IS in scope (if I define it without xsl:if it works)
xml -> <area position="1"> or <area position="2">
thanks in advance
Aniceto Lopez
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list