preload

ChildElementByName (QTP, TestComplete, VBScript)

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