Re: [xsl] Multiple expressions in if conditons

Subject: Re: [xsl] Multiple expressions in if conditons
From: Ronan Klyne <ronan.klyne@xxxxxxxxxxx>
Date: Fri, 16 Feb 2007 14:35:57 +0000
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.klyne@xxxxxxxxxxx
www.groupbc.com

Current Thread