<root>
<child id = 1> <subroot> <element id = 1 /> </subroot> </child>
<child id = 2 > <subroot> <element id = 2 /> </subroot> </child>
<child id = 3> <subroot> <element id = 3 /> </subroot> </child>
<child id =4 > <subroot> <element id = 4 /> </subroot> </child>
<child id = 5> <subroot> <element id = 5 /> </subroot> </child>
<child id =6> <subroot> <element id = 6 /> </subroot> </child>
</root>
In the above xml, I need to get the "child" nodes and again needs to query the subroot nodes using xpath.
xpath to get child node :
XmlNodelist child = doc.SelectNodes("//root/ch
ild")
foreach(XmlNode item in XmlNodeList)
{
item.selectnodes(//subroot
/); //hereafter this should be taken as root node
}
but the second xpath query, again searches from root node. how set the child node as root?