xsl-list
[Top] [All Lists]

Re: [xsl] Multiple expressions in if conditons

2007-02-16 07:36:16
Thangavelu Srinivasan wrote:
<xsl:if test= "$code != ('state_results') or ('game_results')">

I am not able to test multiple value using if condition. i want to
confirm whether my if conditon is correct for checking multiple value

The line excerpted above is not what I think you mean. (This much you know)

$code != ('state_results') or ('game_results')
means that either
$code != ('state_results') is true OR
('game_results') is true.

I think you meant the conditional to be true when $code is not equal to
either of the strings. For this result, you need to specify the following:
$code != ('state_results') and $code != ('game_results')

Note the change from 'or' to 'and'.
Saying that $code is not a or b is equivalent to saying that $code is
not a, and $code is not b.
In this case, the important is that the 'or' operator in XSL does not
work like 'or' in English. XSL's 'or' works on boolean values only.

HTH

        # r


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 (0)870 163 2555
ronan(_dot_)klyne(_at_)groupbc(_dot_)com
www.groupbc.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>