preload

ChildElementValueByName (QTP, TestComplete, VBScript)

Posted by Albert Gareev on Aug 20, 2008 | Categories: Source codeXML Data

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

Description

Returns text value of a child XML node.

Implementation

Public Function ChildElementValueByName(ByRef objXMLParent, ByVal sTagName)
 Dim objNode

 If objXMLParent is Nothing Then
  Set ChildElementValueByName = ""
  Exit Function
 End If

 Set objNode = objXMLParent.SelectSingleNode("./"&sTagName)
 If isNull(objNode) Or (objNode is Nothing) Then
  ChildElementValueByName = ""
 Else
  ChildElementValueByName = p_GetXMLElementText(objNode)
 End If
 
End Function

  • Leave a Reply

    * Required
    ** Your Email is never shared

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.