p_GetXMLElementCDataByIndex (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Description
Get CData text from a child node specified by index.
Implementation
Private Function p_GetXMLElementCDataByIndex(ByRef objXMLElement, ByVal intIndex) Dim objColl, Iter, IndexIter Set objColl = objXMLElement.ChildNodes IndexIter = -1 For Iter=0 To objColl.length-1 If objColl.Item(Iter).NodeName = "#cdata-section" Then IndexIter = IndexIter + 1 If IndexIter = intIndex Then p_GetXMLElementCDataByIndex = objColl.Item(Iter).NodeValue Exit Function End If End If Next p_GetXMLElementCDataByIndex = "" End Function