Querying XML doc with Excel VBA
I'm building a list of nodes I need to load from XML document using SelectNodes(xpath):
Set oNodeList = xmldoc.selectNodes("//Object/Property[@Name='Group' and Value='True']")
and looping thru the nodes:
For Each curNode In oNodeList
Set nAttr = curNode.parentNode.Attributes
If (nAttr.getNamedItem("Seq").nodeValue = "abc") Then
' additional processing
End If
Next
Additional processing involves looping thru child nodes of curNode. I was wondering if it's possible in build yet another n开发者_运维知识库odeList using selectNodes which would select child nodes of curNode that meet particular criteria. The key point that xpath should start looking from the current node.
How can I do that?
Alejandro, thank you! It seems like
curNode.Selectnodes("child::*")
does the trick!
精彩评论