XML DOM selectSingleNode() method

Node object reference manual

Definition and usage

The selectSingleNode() method finds a node that matches the XPath query.

Syntax:

nodeObject.selectSingleNode(query)
Parameters Description
query XPath query string.

Return value

A single Node that matches the query. If not, it is null.

Description

This method specific to IE calculates an XPath expression using this node as the context node. It returns the first matching node found, or null if no matching node is found.

This selectSingleNode() method exists only on XML document nodes and does not exist in HTML documents. Note that since Document objectThey are their own nodes, and this method can be applied to the entire XML document.

See Document.evaluate(), for an alternative cross-browser method.

See

Document.createExpression()

Node object reference manual