Microsoft XML SDK 2.6 - XML Reference

IXMLDOMNode::selectNodes Method

Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes.

Visual Basic Syntax

Set objXMLDOMNodeList = oXMLDOMNode.selectNodes(patternString)

C/C++ Syntax

HRESULT selectNodes(
    BSTR patternString,
    IXMLDOMNodeList **resultList);

Parameters

patternString [in]
XSL or XPath expression that is to be applied to the context defined by this node. Whether an XSL or XPath query is used is determined by the value of the SelectionLanguage property. By default, the expression is an XSL pattern query. The SelectionLanguage property can be set with the SetProperty method.
resultList [out]
List of nodes selected by the XSL or XPath query. If no nodes are selected by the query, an empty node list is returned.

C/C++ Return Values

S_OK
Value returned if successful.
E_INVALIDARG
Value returned if resultList is Null.

Remarks

For a complete description of XSL Syntax, see XSL Pattern Syntax.

For a complete description of XPath syntax, see the XPath Syntax reference.

The selectSingleNode method is much like the selectNodes method but returns only the first matching node rather than the list of all matching nodes.

The IXMLDOMNodeList is live and immediately reflects changes to the nodes that appear in the list.

See Also

IXMLDOMNode Interface | Using the XSLT Processor | Using Collections