ChildAttributeValueByName (QTP, TestComplete, VBScript)
Parent page: Service Functions – MSXMLDOM (QTP, TestComplete, VBScript)
Description
- Returns text value of node’s child attribute specified by name.
- Valid arguments: an XML element node (NODE_ELEMENT type), name of the attribute.
- If XML node is not defined, returns empty string.
- Uses private function p_GetXMLElementAttrText, defined within the library (see parent page).
Implementation
Public Function ChildAttributeValueByName(ByRef objXMLNode, ByVal sAttrName) If objXMLNode is Nothing Then ChildAttributeValueByName = "" Exit Function End If sAttrName = Trim(sAttrName) ChildAttributeValueByName = p_GetXMLElementAttrText(objXMLNode, sAttrName) End Function