p_GetXMLElementText (QTP, TestComplete, VBScript)

Categories: Source codeXML Data

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

Description

Get inner text, combined from all child text nodes.

Implementation

Private Function p_GetXMLElementText(ByRef objXMLElement)
 Dim objColl, Iter
 Dim sResult
 Set objColl = objXMLElement.ChildNodes
 sResult = ""
 For Iter=0 To objColl.length-1
 If objColl.Item(Iter).NodeName = "#text" Then
 sResult = sResult & objColl.Item(Iter).NodeValue
 End If
 Next
 p_GetXMLElementText = sResult
End Function

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