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
> 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