Microsoft XML 2.5 SDK


 

IXMLDOMNode::selectSingleNode Method

[This is preliminary documentation and subject to change.]

Applies the specified pattern to this node's context and returns the first matching node.

Visual Basic Syntax

Set objXMLDOMNode = oXMLDOMNode.selectSingleNode(patternString)

C/C++ Syntax

HRESULT selectSingleNode(

    BSTR patternString,

    IXMLDOMNode **resultNode);

Parameters

patternString

[in]
XSL Pattern that is to be used in the query; applied to this node's context.

resultNode

[out]
First node that is selected by the XSL Pattern query. If no nodes result from the query, it returns NULL.

C/C++ Return Values

S_OK

Value returned if successful.

S_FALSE

Value when returning null.

E_INVALIDARG

Value returned if resultNode is null.

Remarks

For an overview of XSL, see Using the XSL Processor. For a complete description of XSL patterns, see the XSL Pattern 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.