[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] multiple or statements in xsl:when


Subject: Re: [xsl] multiple or statements in xsl:when
From: Daniel Purucker <dpu@xxxxxxxxxxxxxxxxxx>
Date: Fri, 2 Apr 2004 21:16:14 +0200

Sorry, but i'm a little confused (dammed boolean algebra) ;)
What i want is: to run the code if:
a) the name of the tag is void AND
b) there is an attribute "property" which is not empty AND
c) the value of this attribute is either 'container' OR ' assetscontainer' OR and so on


for example run the code for this line of xml:
<void property="container"> and also for this line
<void property="assetscontainer">

but for example not for this line:
<void property="string">


Daniel



Am 02.04.2004 um 20:28 schrieb Michael Kay:



<xsl:when test="name(.)='void' and @property !='' and @property != 'container' or @property != 'container' or @property != 'assetscontainer' or @property != 'incomecontainer' or @property != 'value' or @property != 'variable' " </xsl:when>

Any ideas why my code doesn't work?

Because your logic is flawed.


if @property != 'value' is false, then @property must equal "value", and
therefore @property != 'variable' will be true. So at least one of these
terms will be true, therefore the whole condition will be true.


Michael Kay


Current Thread