[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Unexpected behavior with xsl:choose, xsl:when, xsl

Subject: Re: Unexpected behavior with xsl:choose, xsl:when, xsl:variable
From: Mukul Gandhi <mukulw3@xxxxxxxxx>
Date: Fri, 8 Aug 2003 08:25:05 -0700 (PDT)
xsl request parameter
Hi Samuel,
  Though its difficult to tell with 100% surety what
might be wrong with your XSL. If possible you may send
your complete XSL and XML and tell us which XSLT
processor you are using.. It will help us to locate
the problem..

Please also try these for debugging --
a) try using normalize-space() function to encapsulate
$var1 before comparison. This would remove any leading
and trailing spaces from the string.

b) try printing the string length of $var1 using
string-length() function. pls see if it is 1 .. 

Regards,
Mukul


--- Samuel Bruce <bperryman_us@xxxxxxxxx> wrote:
> 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
> 


__________________________________
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.