You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Jo...@it-informatik.de on 2003/10/01 10:13:46 UTC

Antwort: Re: XPath expression question.

Hi!

>> If I have several elements with name , say "elem". Some of these "elem"
>> elements have "attr" attributes and some don't.
>> How do I get those "elem" nodes which DO NOT have the "attr" attribute
>> ?
>>
>>
>> elem[@attr] - will give all the "elem" nodes with "attr" attribute.
>> elem - will give ALL "elem" nodes.

>You might try something like elem[count(@attr) = 0]
>Hope that helps

You may also try

elem[not(@attr)]

which communicates your intent more clearly.

Joerg Seidler