XMLNodeSet2Dictionary (QTP, TestComplete, VBScript)

Posted by Albert Gareev on Jul 20, 2011 | Categories: Source codeXML Data

Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)

Service Functions – Dictionary (QTP, TestComplete, VBScript)


For each occurrence of XML node perform conversion to Dictionary, and store all records in indexed Dictionary object.


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))
  Set XMLNodeSet2Dictionary = objDictionary
End Function

Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported
This work by Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.