In XPath, the name of an element without a prefix is โโalways considered in an empty namespace. In XML, however, there is a default namespace that elements inherit differently by default, this is in your specific XML:
xmlns="uuid:ebfd9-45-48-a9eb-42d"
I would suggest using a default prefix, such as d , in your XPath. And then map the prefix to the root element namespace:
...... Dim nsManager As New XmlNamespaceManager(New NameTable()) nsManager.AddNamespace("d", m_xmld.DocumentElement.NamespaceURI) test = doc.SelectSingleNode("d:Data/d:Info", nsManager)
The above will work in both cases (an XML document with and without a default namespace), but not in the case of XML with a default namespace declared locally at the descendant level.
source share