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

System.Xml.XmlNode.SelectSingleNode Method

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

public XmlNode SelectSingleNode (string xpath, XmlNamespaceManager nsmgr)

Parameters

xpath
The XPath expression. [Edit]
nsmgr
The context in which to evaluate the expression, or null. [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 the first node of resulting nodes that match the expression as System.Xml.XmlNode.

The argument XPath expression is compiled with the argument nsmgr. That is, the namespace prefixes used in xpath have nothing to do with the actual XmlNode.Prefix property values in the tree. It is the namespace URIs stored in nsmgr which are significant.

[Edit]

Requirements

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