XPathNavigator Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Provides a cursor model for navigating and editing XML data.
Inheritance Hierarchy
System.Object
System.Xml.XPath.XPathItem
System.Xml.XPath.XPathNavigator
Namespace: System.Xml.XPath
Assembly: System.Xml.XPath (in System.Xml.XPath.dll)
Syntax
'Declaration
<DebuggerDisplayAttribute("{debuggerDisplayProxy}")> _
Public MustInherit Class XPathNavigator _
Inherits XPathItem _
Implements IXPathNavigable, IXmlNamespaceResolver
[DebuggerDisplayAttribute("{debuggerDisplayProxy}")]
public abstract class XPathNavigator : XPathItem,
IXPathNavigable, IXmlNamespaceResolver
The XPathNavigator type exposes the following members.
Constructors
Name | Description | |
---|---|---|
XPathNavigator | Initializes a new instance of the XPathNavigator class. |
Top
Properties
Name | Description | |
---|---|---|
BaseURI | When overridden in a derived class, gets the base URI for the current node. | |
CanEdit | Gets a value indicating whether the XPathNavigator can edit the underlying XML data. | |
HasAttributes | Gets a value indicating whether the current node has any attributes. | |
HasChildren | Gets a value indicating whether the current node has any child nodes. | |
InnerXml | Gets or sets the markup representing the child nodes of the current node. | |
IsEmptyElement | When overridden in a derived class, gets a value indicating whether the current node is an empty element without an end element tag. | |
IsNode | Gets a value indicating if the current node represents an XPath node. (Overrides XPathItem.IsNode.) | |
LocalName | When overridden in a derived class, gets the Name of the current node without any namespace prefix. | |
Name | When overridden in a derived class, gets the qualified name of the current node. | |
NamespaceURI | When overridden in a derived class, gets the namespace URI of the current node. | |
NameTable | When overridden in a derived class, gets the XmlNameTable of the XPathNavigator. | |
NavigatorComparer | Gets an IEqualityComparer used for equality comparison of XPathNavigator objects. | |
NodeType | When overridden in a derived class, gets the XPathNodeType of the current node. | |
OuterXml | Gets or sets the markup representing the opening and closing tags of the current node and its child nodes. | |
Prefix | When overridden in a derived class, gets the namespace prefix associated with the current node. | |
UnderlyingObject | Used by XPathNavigator implementations which provide a "virtualized" XML view over a store, to provide access to underlying objects. | |
Value | When overridden in a derived class, gets the string value of the item. (Inherited from XPathItem.) | |
XmlLang | Gets the xml:lang scope for the current node. |
Top
Methods
Name | Description | |
---|---|---|
AppendChild() | Returns an XmlWriter object used to create one or more new child nodes at the end of the list of child nodes of the current node. | |
AppendChild(String) | Creates a new child node at the end of the list of child nodes of the current node using the XML data string specified. | |
AppendChild(XmlReader) | Creates a new child node at the end of the list of child nodes of the current node using the XML contents of the XmlReader object specified. | |
AppendChild(XPathNavigator) | Creates a new child node at the end of the list of child nodes of the current node using the nodes in the XPathNavigator specified. | |
AppendChildElement | Creates a new child element node at the end of the list of child nodes of the current node using the namespace prefix, local name and namespace URI specified with the value specified. | |
Clone | When overridden in a derived class, creates a new XPathNavigator positioned at the same node as this XPathNavigator. | |
ComparePosition | Compares the position of the current XPathNavigator with the position of the XPathNavigator specified. | |
Compile | Compiles a string representing an XPath expression and returns an XPathExpression object. | |
CreateAttribute | Creates an attribute node on the current element node using the namespace prefix, local name and namespace URI specified with the value specified. | |
CreateAttributes | Returns an XmlWriter object used to create new attributes on the current element. | |
CreateNavigator | Returns a copy of the XPathNavigator. | |
DeleteRange | Deletes a range of sibling nodes from the current node to the node specified. | |
DeleteSelf | Deletes the current node and its child nodes. | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Evaluate(String) | Evaluates the specified XPath expression and returns the typed result. | |
Evaluate(XPathExpression) | Evaluates the XPathExpression and returns the typed result. | |
Evaluate(String, IXmlNamespaceResolver) | Evaluates the specified XPath expression and returns the typed result, using the IXmlNamespaceResolver object specified to resolve namespace prefixes in the XPath expression. | |
Evaluate(XPathExpression, XPathNodeIterator) | Uses the supplied context to evaluate the XPathExpression, and returns the typed result. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetAttribute | Gets the value of the attribute with the specified local name and namespace URI. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetNamespace | Returns the value of the namespace node corresponding to the specified local name. | |
GetNamespacesInScope | Returns the in-scope namespaces of the current node. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InsertAfter() | Returns an XmlWriter object used to create a new sibling node after the currently selected node. | |
InsertAfter(String) | Creates a new sibling node after the currently selected node using the XML string specified. | |
InsertAfter(XmlReader) | Creates a new sibling node after the currently selected node using the XML contents of the XmlReader object specified. | |
InsertAfter(XPathNavigator) | Creates a new sibling node after the currently selected node using the nodes in the XPathNavigator object specified. | |
InsertBefore() | Returns an XmlWriter object used to create a new sibling node before the currently selected node. | |
InsertBefore(String) | Creates a new sibling node before the currently selected node using the XML string specified. | |
InsertBefore(XmlReader) | Creates a new sibling node before the currently selected node using the XML contents of the XmlReader object specified. | |
InsertBefore(XPathNavigator) | Creates a new sibling node before the currently selected node using the nodes in the XPathNavigator specified. | |
InsertElementAfter | Creates a new sibling element after the current node using the namespace prefix, local name and namespace URI specified, with the value specified. | |
InsertElementBefore | Creates a new sibling element before the current node using the namespace prefix, local name, and namespace URI specified, with the value specified. | |
IsDescendant | Determines whether the specified XPathNavigator is a descendant of the current XPathNavigator. | |
IsSamePosition | When overridden in a derived class, determines whether the current XPathNavigator is at the same position as the specified XPathNavigator. | |
LookupNamespace | Gets the namespace URI for the specified prefix. | |
LookupPrefix | Gets the prefix declared for the specified namespace URI. | |
Matches(String) | Determines whether the current node matches the specified XPath expression. | |
Matches(XPathExpression) | Determines whether the current node matches the specified XPathExpression. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
MoveTo | When overridden in a derived class, moves the XPathNavigator to the same position as the specified XPathNavigator. | |
MoveToAttribute | Moves the XPathNavigator to the attribute with the matching local name and namespace URI. | |
MoveToChild(XPathNodeType) | Moves the XPathNavigator to the child node of the XPathNodeType specified. | |
MoveToChild(String, String) | Moves the XPathNavigator to the child node with the local name and namespace URI specified. | |
MoveToFirst | Moves the XPathNavigator to the first sibling node of the current node. | |
MoveToFirstAttribute | When overridden in a derived class, moves the XPathNavigator to the first attribute of the current node. | |
MoveToFirstChild | When overridden in a derived class, moves the XPathNavigator to the first child node of the current node. | |
MoveToFirstNamespace() | Moves the XPathNavigator to first namespace node of the current node. | |
MoveToFirstNamespace(XPathNamespaceScope) | When overridden in a derived class, moves the XPathNavigator to the first namespace node that matches the XPathNamespaceScope specified. | |
MoveToFollowing(XPathNodeType) | Moves the XPathNavigator to the following element of the XPathNodeType specified in document order. | |
MoveToFollowing(String, String) | Moves the XPathNavigator to the element with the local name and namespace URI specified in document order. | |
MoveToFollowing(XPathNodeType, XPathNavigator) | Moves the XPathNavigator to the following element of the XPathNodeType specified, to the boundary specified, in document order. | |
MoveToFollowing(String, String, XPathNavigator) | Moves the XPathNavigator to the element with the local name and namespace URI specified, to the boundary specified, in document order. | |
MoveToId | When overridden in a derived class, moves to the node that has an attribute of type ID whose value matches the specified String. | |
MoveToNamespace | Moves the XPathNavigator to the namespace node with the specified namespace prefix. | |
MoveToNext() | When overridden in a derived class, moves the XPathNavigator to the next sibling node of the current node. | |
MoveToNext(XPathNodeType) | Moves the XPathNavigator to the next sibling node of the current node that matches the XPathNodeType specified. | |
MoveToNext(String, String) | Moves the XPathNavigator to the next sibling node with the local name and namespace URI specified. | |
MoveToNextAttribute | When overridden in a derived class, moves the XPathNavigator to the next attribute. | |
MoveToNextNamespace() | Moves the XPathNavigator to the next namespace node. | |
MoveToNextNamespace(XPathNamespaceScope) | When overridden in a derived class, moves the XPathNavigator to the next namespace node matching the XPathNamespaceScope specified. | |
MoveToParent | When overridden in a derived class, moves the XPathNavigator to the parent node of the current node. | |
MoveToPrevious | When overridden in a derived class, moves the XPathNavigator to the previous sibling node of the current node. | |
MoveToRoot | Moves the XPathNavigator to the root node that the current node belongs to. | |
PrependChild() | Returns an XmlWriter object used to create a new child node at the beginning of the list of child nodes of the current node. | |
PrependChild(String) | Creates a new child node at the beginning of the list of child nodes of the current node using the XML string specified. | |
PrependChild(XmlReader) | Creates a new child node at the beginning of the list of child nodes of the current node using the XML contents of the XmlReader object specified. | |
PrependChild(XPathNavigator) | Creates a new child node at the beginning of the list of child nodes of the current node using the nodes in the XPathNavigator object specified. | |
PrependChildElement | Creates a new child element at the beginning of the list of child nodes of the current node using the namespace prefix, local name, and namespace URI specified with the value specified. | |
ReadSubtree | Returns an XmlReader object that contains the current node and its child nodes. | |
ReplaceRange | Replaces a range of sibling nodes from the current node to the node specified. | |
ReplaceSelf(String) | Replaces the current node with the content of the string specified. | |
ReplaceSelf(XmlReader) | Replaces the current node with the contents of the XmlReader object specified. | |
ReplaceSelf(XPathNavigator) | Replaces the current node with the contents of the XPathNavigator object specified. | |
Select(String) | Selects a node set, using the specified XPath expression. | |
Select(XPathExpression) | Selects a node set using the specified XPathExpression. | |
Select(String, IXmlNamespaceResolver) | Selects a node set using the specified XPath expression with the IXmlNamespaceResolver object specified to resolve namespace prefixes. | |
SelectAncestors(XPathNodeType, Boolean) | Selects all the ancestor nodes of the current node that have a matching XPathNodeType. | |
SelectAncestors(String, String, Boolean) | Selects all the ancestor nodes of the current node that have the specified local name and namespace URI. | |
SelectChildren(XPathNodeType) | Selects all the child nodes of the current node that have the matching XPathNodeType. | |
SelectChildren(String, String) | Selects all the child nodes of the current node that have the local name and namespace URI specified. | |
SelectDescendants(XPathNodeType, Boolean) | Selects all the descendant nodes of the current node that have a matching XPathNodeType. | |
SelectDescendants(String, String, Boolean) | Selects all the descendant nodes of the current node with the local name and namespace URI specified. | |
SelectSingleNode(String) | Selects a single node in the XPathNavigator using the specified XPath query. | |
SelectSingleNode(XPathExpression) | Selects a single node in the XPathNavigator using the specified XPathExpression object. | |
SelectSingleNode(String, IXmlNamespaceResolver) | Selects a single node in the XPathNavigator object using the specified XPath query with the IXmlNamespaceResolver object specified to resolve namespace prefixes. | |
SetValue | Sets the value of the current node. | |
ToString | Gets the text value of the current node. (Overrides Object.ToString().) | |
WriteSubtree | Streams the current node and its child nodes to the XmlWriter object specified. |
Top
Remarks
The XPathNavigator class in the System.Xml.XPath namespace is an abstract class which defines a cursor model for navigating and editing XML information items as instances of the XQuery 1.0 and XPath 2.0 Data Model.
An XPathNavigator object is created from a class that implements the IXPathNavigable interface such as the XPathDocument and XmlDocument classes. XPathNavigator objects created by XPathDocument objects are read-only while XPathNavigator objects created by XmlDocument objects can be edited. An XPathNavigator object's read-only or editable status is determined using the CanEdit property of the XPathNavigator class.
For more information about processing XML data using the XPath data model, see the Process XML Data Using the XPath Data Model topic.
Security Note: |
---|
Exceptions raised as a result of using the XPathNavigator class, such as the XPathException class, may contain sensitive information that should not be exposed in untrusted scenarios. Exceptions should be properly handled so that this sensitive information is not exposed in untrusted scenarios. |
Version Information
Silverlight
Supported in: 5, 4
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.