This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Evaluating using xsl:if


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]