Mono Class Library: System.Xml.XmlNode Overview | Members

System.Xml.XmlNode.SelectSingleNode Method

Run an XPath expression against this node, returning the first matching node. [Edit]

public XmlNode SelectSingleNode (string xpath)

Parameters

xpath
The XPath expression. [Edit]

Returns

The first node that matches the expression, or null if no node matches the expression. [Edit]

Remarks

It compiles the argument XPath expression and evaluates it against this node and returns resulting nodes that match the expression as System.Xml.XmlNodeList.

With this method namespaces cannot be considered. To select nodes which have namespace URI, use XmlNode.SelectNodes(string, XmlNamespaceManager) instead.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0