To get all the nodes within a node whose attribute value is specified

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi all,
I have an xml as below,

<report
<page pageNo="1
<span style="white-space:pre <line lineNo="1 value = "Hi11 </line>
<span style="white-space:pre <line lineNo="2 value = "Hi21 </line>
</page>

page pageNo="2
<span style="white-space:pre <line lineNo="1 value = "Hi12 </line>
<span style="white-space:pre <line lineNo="2 value = "Hi22 </line>
</page>

page pageNo="3
<span style="white-space:pre <line lineNo="1 value = "Hi13 </line>
<span style="white-space:pre <line lineNo="2 value = "Hi23 </line>
</page>

page pageNo="4
<span style="white-space:pre <line lineNo="1 value = "Hi14 </line>
<span style="white-space:pre <line lineNo="2 value = "Hi24 </line>
</page>
</report>

By using the xpath query, "/report//*[self::page | self::line ]", I got all the page and line nodes within the xml. But I want all the page and line nodes within the page nodes with pageNo = 3 and 4..... This means I should get the page nodes as well
as line nodes within the pages with page numbers 3 and 4 as IXMLDOMNodeList.... Please help me





View the full article
 
Back
Top