Returns a collection of elements that have the specified name.
Visual Basic Syntax
Set objXMLDOMNodeList = oXMLDOMDocument.XMLDOMDocument(tagName)
C/C++ Syntax
HRESULT getElementsByTagName( BSTR tagname, IXMLDOMNodeList **resultList);
Parameters
- tagname
- [in] Element name to find. The tagname "*" returns all elements in the document.
- resultList
- [out] Address of a collection of elements that match the specified name.
C/C++ Return Value
Returns S_OK if successful, or an error code otherwise.
Remarks
The elements in the collection are returned in the order in which they would be encountered in a preorder traversal of the document tree. In a preorder traversal, the parent root node is visited first, then each child node from left to right is traversed.
The returned IXMLDOMNodeList object is live and immediately reflects changes to the nodes that appear in the list.
More complex searches can be performed using the selectNodes method, which may also be faster in some cases.