preload

p_GetXMLElementText (QTP, TestComplete, VBScript)

Posted by Albert Gareev on Jul 16, 2008 | 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 Albert Gareev is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported.