I have an loaded some XML in an XMLDocument object. I am iterating through the document by using an
For Each node As XmlNode In doc.GetElementsByTagName("Item", [NAMESPACE])
'Do Stuff
Next
I would like to use xpath within this loop to pull out all nodes with the name of "MyNode" I would have thought i would simply have to do node.SelectNodes("MyNode"), but this returns a list of zero.
<Root>
<Item>
<MyNode></MyNode>
<MyNode></MyNode>
<MyNode></MyNode>
<RandomOtherNode></RandomOtherNode>
<RandomOtherNode></RandomOtherNode>
</Item>
<MyNode></MyNode>
<MyNode></MyNode>
<MyNode></MyNode>
<RandomOtherNode></RandomOtherNode>
<RandomOtherNode></RandomOtherNode>
<Item>
</Item>
<Item>
<MyNode></MyNode>
<MyNode></MyNode>
<MyNode></MyNode>
<RandomOtherNode></RandomOtherNode>
<RandomOtherNode></RandomOtherNode>
</Item>
</Root>
Do i have to do something extra?