tags:

views:

54

answers:

2

Is it possible to create an XPath expression that matches all child nodes that are not of a certain name? E.g.

<a>
 <b />
 <c />
 <d />
 <e />
 <f />
 <g />
</a>

How would I select all children of the 'a' node that are not a 'b' node?

+4  A: 
/a/*[not(self::b)]
Dewfy
Quick and perfect :)Thank you.
izb
+2  A: 

Or with XPath 2.0

/a/(* except b)
Martin Honnen