Select all nodes which not contain a child node with specific attribute value

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi together,
in a given XML:

<pre lang="x-xml <xml>
<item>
<id>1</id>
<data type="up"/>
<data type="down"/>
<data type="left"/>
</item>
<item>
<id>2</id>
<data type="down"/>
</item>
<item>
<id>3</id>
<data type="down"/>
<data type="left"/>
</item>
<item>
<id>4</id>
<data type="up"/>
<data type="down"/>
<data type="left"/>
</item>
</xml>[/code]



How can i retrieve with a LinqToXML query all "item" nodes which not contains a child node "data" where its attribute "type" has the value "up"?

Thanks in advance,

el-gokulo


View the full article
 
Back
Top