XMLNodeSet2Dictionary (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Service Functions – Dictionary (QTP, TestComplete, VBScript)
Description
For each occurrence of XML node perform conversion to Dictionary, and store all records in indexed Dictionary object.
Implementation
Public Function XMLNodeSet2Dictionary(ByRef objXMLNodeSet)
Dim objDictionary
Dim Iter
Set objDictionary = CreateObject("Scripting.Dictionary")
If objXMLNodeSet is Nothing Then
Set XMLNodeSet2Dictionary = objDictionary
Exit Function
End If
For Iter=0 To objXMLNodeSet.length-1
Set objDictionary.Item(Iter+1) = XMLNode2Dictionary(objXMLNodeSet.Item(Iter))
Next
Set XMLNodeSet2Dictionary = objDictionary
End Function

