ArB*_*rBR 11
下面是一些你可以使用函数解析您的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
Run Code Online (Sandbox Code Playgroud)
有关MSXML的更多信息,请参阅MSDN:http://msdn.microsoft.com/en-us/library/aa468547.aspx