I have an XML ResponseXML object. I'd like to loop throught all nodes called "XYZ". How do I do this?
Here are some functions you can use for parsing your XML:
Private xml As MSXML.DOMDocument
Private Sub loadXMLFile(xmlFile)
Set xml = New DOMDocument
xml.async = False
xml.Load (xmlFile)
End Sub
Private Sub loadXMLString(xmlString)
Set xml = New DOMDocument
xml.LoadXml (xmlString)
End Sub
Public Function getNodeValue(xpath As String) As String
getNodeValue = xml.SelectSingleNode(strXPath).Text
End Function
Public Function getNodes(xpath as string) As IXMLDOMNodeList
Set getNodes = xml.SelectNodes(xpath)
End Function
Public Function getNode(xpath as string) As IXMLDOMNode
Set getNode = xml.SelectSingleNode(xpath)
End Function
See MSDN for more information about MSXML: http://msdn.microsoft.com/en-us/library/aa468547.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With