If an XPath expression like //JDF/ResourceLinkPool/ComponentLink
does not select elements in your input document then it is likely that you are processing a document which uses namespaces, see http://en.wikipedia.org/wiki/XML_namespaces.
With XPath 1.0 a path like /foo/bar
selects bar
child elements of foo
elements in no namespace while with an XML document of the form
<foo xmlns="http://example.com/ns1">
<bar>baz</bar>
</foo>
the elements are in the namespace http://example.com/ns1
.
With your sample there is probably a default namespace declaration (e.g. xmlns="http://www.CIP4.org/JDFSchema_1_1"
) which requires you to change your XPath expressions by defining a prefix for the namespace e.g.
xmlDoc.setProperty "SelectionNamespaces", "xmlns:jdf='http://www.CIP4.org/JDFSchema_1_1'"
and using it:
Set curNode = xmlDoc.selectSingleNode("//jdf:JDF/jdf:ResourceLinkPool/jdf:ComponentLink")
Documentation for MSXML is at http://msdn.microsoft.com/en-us/library/windows/desktop/ms756048%28v=vs.85%29.aspx.