This documentation is archived and is not being maintained.

XmlNode.SelectSingleNode Method

Selects the first XmlNode that matches the XPath expression.

Name Description
XmlNode.SelectSingleNode (String) Selects the first XmlNode that matches the XPath expression.

Supported by the .NET Compact Framework.

XmlNode.SelectSingleNode (String, XmlNamespaceManager) Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.

Supported by the .NET Compact Framework.

XPath expressions can include namespaces. Namespace resolution is supported using the XmlNamespaceManager. If the XPath expression includes a prefix, the prefix and namespace URI pair must be added to the XmlNamespaceManager.

NoteNote:

If the XPath expression does not include a prefix, it is assumed that the namespace URI is the empty namespace. If your XML includes a default namespace, you must still add a prefix and namespace URI to the XmlNamespaceManager; otherwise, you will not get any nodes selected. For more information, see Select Nodes Using XPath Navigation.

Show: