Provides an iterator over a selected set of nodes.
Assembly: System.Xml (in System.Xml.dll)
Gets the index of the last node in the selected set of nodes.
When overridden in a derived class, gets the XPathNavigator object for this , positioned on the current context node.
When overridden in a derived class, gets the index of the current position in the selected set of nodes.
When overridden in a derived class, returns a clone of thisobject.
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Returns an IEnumerator object to iterate through the selected node set.
Serves as the default hash function. (Inherited from Object.)
Returns a string that represents the current object.(Inherited from Object.)
Creates a new object that is a copy of the current instance.
Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)
An XPathNavigator class is not positioned on the first node in a selected set of nodes. A call to the MoveNext method of the class must be made to position the object on the first node in the selected set of nodes.object returned by the
When using the XPathNavigator array, copy all of the nodes from the into the array, then iterate through the array and modify the nodes., if you edit the current node or any of its ancestors, your current position is lost. If you want to edit a number of nodes that you have selected, create a
There are two ways to iterate over an XPathNavigator collection by using the class.
You should either use MoveNext and Current or use GetEnumerator. Combining these two approaches can cause unexpected results. For example, if the MoveNext method is called first, and then the GetEnumerator method is called in the foreach loop, the foreach loop will not start enumerating the results from the beginning of the collection, but from the position after the Current method.
Notes to Inheritors:
When you inherit from theclass, you must override the following members:
The example takes the books.xml file as input.
<?xml version="1.0" encoding="utf-8" ?> <bookstore> <book genre="autobiography" publicationdate="1981-03-22" ISBN="1-861003-11-0"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Benjamin</first-name> <last-name>Franklin</last-name> </author> <price>8.99</price> </book> <book genre="novel" publicationdate="1967-11-17" ISBN="0-201-63361-2"> <title>The Confidence Man</title> <author> <first-name>Herman</first-name> <last-name>Melville</last-name> </author> <price>11.99</price> </book> <book genre="philosophy" publicationdate="1991-02-15" ISBN="1-861001-57-6"> <title>The Gorgias</title> <author> <name>Plato</name> </author> <price>9.99</price> </book> </bookstore>
Available since 10
Available since 1.1
Available since 4.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.