' Get a XML node value ' expC1 Node Public Function GetXMLNodeValue(ByVal tcNode As String) As Boolean ' Reset cMessage = "" cNodeInnerText = "" cNodeInnerXML = "" ' Select the node If oXmlNameSpaceManager Is Nothing Then oXmlNode = oXmlDocument.SelectSingleNode(tcNode) Else oXmlNode = oXmlDocument.SelectSingleNode(tcNode, oXmlNameSpaceManager) End If ' See if we obtained the node If oXmlNode Is Nothing Then cMessage = oApp.StrTran(cNodeDoesNotExist, "##Node##", tcNode) Return False End If Try cNodeInnerText = oXmlNode.InnerText cNodeInnerXML = oXmlNode.InnerXml Catch loError As Exception cMessage = loError.Message Return False End Try Return True End FunctionThis is how I call it:
' Get the model number If Not loXml.GetXMLNodeValue("//Root.Node/Model/ModelNumber") Then Return False End IfSo, this works as I thought until I discovered something weird today. Basically, someone has added an additional root node. So, the full reference is now: