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

Re: [xsl] Predicates


Subject: Re: [xsl] Predicates
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 7 Jan 2005 16:12:13 GMT

> I have tried several combinations, but none work...am I heading in the right
> direction?

The boolean operator for or is or not | (not sure why so many people miss
this)

[not(name='Frank Lampard' or  name=' Damian Deff')]

or


[(name!='Frank Lampard') and  (name!=' Damian Deff')]

although beware of using != ever in Xpath unless you are sure you know
what you are doing. It has quite entertaining meaning and in the cases
where it isn't the same as using not (   =    ) it almost always doesn't
do what you want, so I find it's better to simply always use  not() and
= rather than !=.

Of the things you tried:


[name!='Frank Lampard | Damian Duff']

That is legal and tests that every name element is not equal to teh
string 'Frank Lampard | Damian Duff'


[name!='Frank Lampard' | name!=' Damian Duff']

that is a syntax error as | is set union and can only be applied to node
sets, not to boolean expressions.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


Current Thread
Keywords