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

RE: Evaluating using xsl:if

Subject: RE: Evaluating using xsl:if
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 2 Oct 2000 10:07:42 +0100
using xsl if comparison
> i have a constant declared as follows:
> <xsl:variable name="account">
>     on
> </xsl:variable>
> in the same xsl if i use the following the condition is not 
> evaluated to 
> true. can anybody answer my question.Is there any way to test this 
> condition?
> 
>     <xsl:if test="'{$account}'='on'">

1. get rid of the curly brackets and the first pair of quotes:

<xsl:if test="$account='on'">

(Curly brackets are never used inside an XPath expression, they are only
used to nest an XPath expression within an attribute value that is
designated as an attribute value template).

2. get rid of the leading and trailing spaces, either by declaring the
"constant" as
<xsl:variable name="account">on</account>
or by using normalize-space() in the comparison.

Mike Kay


 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.