ChildElementByName (QTP, TestComplete, VBScript)

Categories: Source codeXML Data

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

Description

Returns child node by tag name.

Implementation

Public Function ChildElementByName(ByRef objXMLParent, ByVal sTagName)
 Dim objNode
 If objXMLParent is Nothing Then
 Set ChildElementByName = Nothing
 Exit Function
 End If
 Set objNode = objXMLParent.SelectSingleNode("./"&sTagName)
 If isNull(objNode) Or (objNode is Nothing) Then
 Set ChildElementByName = Nothing
 Else
 Set ChildElementByName = objNode
 End If
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.