Code: Select all
Option Explicit
Sub ParseXmlDocument()
Dim doc As New MSXML2.DOMDocument
Dim success As Boolean
success = doc.Load("C:\Lavori_Vb6\TEST_MAPPA" & "\test.xml")
If success = False Then
MsgBox doc.parseError.reason
Else
Dim nodeList As MSXML2.IXMLDOMNodeList
Set nodeList = doc.SelectNodes("/comuni")
If Not nodeList Is Nothing Then
Dim node As MSXML2.IXMLDOMNode
Dim name As String
Dim value As String
For Each node In nodeList
Debug.Print node.Attributes.getNamedItem("comune").Text
'name = node.SelectSingleNode("@id").Text
'value = node.SelectSingleNode("@value").Text
Next node
End If
End If
End Sub