Find by path : DOMDocument « XML « VBA / Excel / Access / Word






Find by path

 
Sub FindNode()
         Dim oXmlDoc As DOMDocument
         Dim oXmlNode As IXMLDOMNode
         Dim oXmlNodes As IXMLDOMNodeList

           Set oXmlDoc = New DOMDocument
           oXmlDoc.async = False
           oXmlDoc.Load (ThisWorkbook.Path & "\EmployeeSales.xml")

           Set oXmlNodes = oXmlDoc.SelectNodes("/EmployeeSales/Employee/Empid")
           For Each oXmlNode In oXmlNodes
           Debug.Print oXmlNode.Text
           Next
End Sub

 








Related examples in the same category

1.Find by value
2.Find by string value
3.Find and Edit the Node that Contains the FirstName Mike
4.Find and Delete all Nodes for the Employee Bullen