1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Private Function ExtractionXML(ByRef oElem As MSXML2.IXMLDOMNode)
Dim oNodeList As MSXML2.IXMLDOMNodeList
Dim i As Long
Select Case oElem.nodeType
Case MSXML2.NODE_ELEMENT 'type Element
Debug.Print oElem.nodeName & " (" & GetAttributes(oElem) & ")"
Case MSXML2.NODE_TEXT 'type texte
Debug.Print "Text: " & oElem.nodeValue
Case MSXML2.NODE_CDATA_SECTION 'type Cdata
Debug.Print "CDATA: " & oElem.nodeValue
Case Else
Debug.Print oElem.nodeType & ": " & oElem.nodeName
End Select
'boucle récursive pour ajouter tous les noeuds enfants
Set oNodeList = oElem.childNodes
For i = 0 To oNodeList.Length - 1
ExtractionXML oNodeList.Item(i)
Next i
'----------------------------------------------------
End Function |