nspreitzer
Programmer
One MILLION dollars to the person who can answer this for me.
Using VBA, I wrote code similar to what is below. That last line is the one in question. If my XPath query is written "ancestor::*", the code works correctly. However, when I replace the astrix with a specific element name, as I have below, the code returns an empty node list. I have tried several different element names which are ancestors to the initial node [ndeTopLevel], but the result is always the same.
I'm using msxml version 6.0.
Any ideas?
Sub Argh()
Dim xmldoc As DOMDocument
Dim ndeTopLevel As IXMLDOMNode
Dim nlstClasses As IXMLDOMNodeList
Set xmldoc = New DOMDocument
xmldoc.Load "c:\blahblahblah.xml"
xmldoc.setProperty "SelectionLanguage", "XPath"
Set ndeTopLevel = xmldoc.FirstChild.FirstChild.FirstChild
Set nlst = ndeTopLevel.selectNodes("ancestor::Group")
End Sub
Using VBA, I wrote code similar to what is below. That last line is the one in question. If my XPath query is written "ancestor::*", the code works correctly. However, when I replace the astrix with a specific element name, as I have below, the code returns an empty node list. I have tried several different element names which are ancestors to the initial node [ndeTopLevel], but the result is always the same.
I'm using msxml version 6.0.
Any ideas?
Sub Argh()
Dim xmldoc As DOMDocument
Dim ndeTopLevel As IXMLDOMNode
Dim nlstClasses As IXMLDOMNodeList
Set xmldoc = New DOMDocument
xmldoc.Load "c:\blahblahblah.xml"
xmldoc.setProperty "SelectionLanguage", "XPath"
Set ndeTopLevel = xmldoc.FirstChild.FirstChild.FirstChild
Set nlst = ndeTopLevel.selectNodes("ancestor::Group")
End Sub