XPath select specific child elements
- by Cool
Hi,
If I have XML tree like this-
<Parent>
<Image Name="a"/>
<Image Name="b"/>
<Child>
<Image Name="c"/>
<Image Name="d"/>
</Child>
<Image Name="e"/>
</Parent>
I want to select all <Image\> nodes except those listed inside <Child\> node.
Currently I am using query to select all Image nodes, -
xElement.XPathSelectElements("//ns:Image", namespace);
Thanks in advance.