Extensions::CreateNavigator Method (XNode^, XmlNameTable^)
Creates an XPathNavigator for an XNode. The XmlNameTable enables more efficient XPath expression processing.
Assembly: System.Xml.Linq (in System.Xml.Linq.dll)
public: [ExtensionAttribute] static XPathNavigator^ CreateNavigator( XNode^ node, XmlNameTable^ nameTable )
Parameters
- node
-
Type:
System.Xml.Linq::XNode^
An XNode that can process an XPath query.
- nameTable
-
Type:
System.Xml::XmlNameTable^
A XmlNameTable to be used by XPathNavigator.
Return Value
Type: System.Xml.XPath::XPathNavigator^An XPathNavigator that can process XPath queries.
You cannot edit the XML tree using the XPathNavigator that is returned by this method. The CanEdit property returns false.
You cannot create an XPathNavigator for a XDocumentType node. Document types do not participate in the XPath data model.
Namespace declarations are reported from left to right. In contrast, for XmlDocument namespaces are reported from right to left. This is conformant behavior because namespace declarations are not ordered in the XPath data model.
The method MoveToId is not supported for navigators that are returned by this method.
If you use an XmlNameTable with this method to create the XPathNavigator, you will get better performance when evaluating XPath expressions.
Available since 3.5
Silverlight
Available since 4.0