public abstract class XPathNodeIterator : ICloneable
|
Count | Read-only Gets the index of the last node in the selected set of nodes. |
Current | Read-only When overridden in a derived class, returns the navigator for this XPathNodeIterator positioned on the current node. |
CurrentPosition | Read-only When overridden in a derived class, gets the index of the current position in the selected set of nodes. |
Clone | When overridden in a derived class, creates a new XPathNodeIterator. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
MoveNext | When overridden in a derived class, moves the XPathNavigator to the next node in the selected set. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
ctor #1 | Default constructor. This constructor is called by derived class constructors to initialize state in this type. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
protected XPathNodeIterator(); |
public virtual int Count {get;}
|
The Count property does not effect the current position of the XPathNodeIterator.
public abstract XPathNavigator Current {get;}
|
Although in the majority of cases the same XPathNavigator is returned for all nodes in the selected node set, this is not guaranteed. In the following example, the resultant node set is a combination of the nodes from the loaded document, "Myfile.xml", and "bar.xml" which was loaded by the XPath engine into an XPathDocument object. Because these are two different data stores ( XmlDocument and XPathDocument), the IXPathNavigable.CreateNavigator method hands out different implementations of the XPathNavigator. Hence, the typeof call will indicate different implementations of the XPathNavigator.Note: This could also occur when passing an XPathNodeIterator to an <msxsl:script> function.
XPathDocument Doc = new XPathDocument("Myfile.xml"); XPathNavigator Nav = Doc.CreateNavigator(); XPathNodeIterator Iterator = Nav.Select("child::* | document(/"bar.xml/")"); while (Iterator.MoveNext()) Console.WriteLine(typeof(Iterator.Current));
If the XPathNavigator.SelectAncestors, XPathNavigator.SelectDescendants and XPathNavigator.SelectChildren methods result in no nodes being selected it is not guaranteed that Current is pointing to the context node.
public abstract int CurrentPosition {get;}
|
public abstract XPathNodeIterator Clone(); |
~XPathNodeIterator(); |
public virtual int GetHashCode(); |
public Type GetType(); |
protected object MemberwiseClone(); |
public abstract bool MoveNext(); |
XPathDocument doc = new XPathDocument("data.xml"); XPathNavigator nav = doc.CreateNavigator(); XPathNodeIterator iterator = nav.Select("/bookstore/book[3]"); while (iterator.MoveNext()){ Console.WriteLine(iterator.Current.Name); }
public virtual string ToString(); |