Export (0) Print
Expand All

XmlNode.SelectNodes Method

Selects a list of nodes matching the XPath expression.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method SelectNodes(String) Selects a list of nodes matching the XPath expression.
Public method SelectNodes(String, XmlNamespaceManager) Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied XmlNamespaceManager.
Top

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.

The following example displays all book titles. The XmlNamespaceManager resolves the default namespace in the XPath expression.

Community Additions

ADD
Show:
© 2014 Microsoft