This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Evaluating using xsl:if
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Evaluating using xsl:if
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Mon, 2 Oct 2000 10:07:42 +0100
- Reply-To: xsl-list at mulberrytech dot com
> 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