[xsl] Unexpected behavior with xsl:choose, xsl:when, xsl:variable

Subject: [xsl] Unexpected behavior with xsl:choose, xsl:when, xsl:variable
From: Samuel Bruce <bperryman_us@xxxxxxxxx>
Date: Fri, 8 Aug 2003 07:40:48 -0700 (PDT)
Hello,

I learned of this list from another users group. I
hope that you won't mind my question.

I have a xsl file which sets an xsl:variable at the
start of the file (before the match:template) from
either a request parameter or a session parameter. The
variable is defined as:

<xsl:variable name="var1">
<xsl:value-of select="parm"/>
</xsl:variable>

Within my xsl:choose I test the value of the variable:

<xsl:choose>
<xsl:when test="$var1='A'">
Display A
 </xsl:when>
<xsl:otherwise>
Display Something Else
 </xsl:otherwise>
</xsl:choose>

The first time through, when the variable is set to
'A' Display A is executed. If I redirect back to this
xsl later when the value of the variable is set to 'A'
Display Something Else is executed.
I have displayed the variable before the test for
debugging purposes and the variable is indeed set to
'A', but the logic doesn't seem to follow.

Is there a way that I can see exactly what the
xsl:when is evaluating? Am I misinterpreting the
behavior of xsl:when?

I am running WIN XP, IE, Tomcat, Cocoon

Thank you

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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


Current Thread