XPathNodeIterator.GetEnumerator Method (System.Xml.XPath)

Switch View :
ScriptFree
.NET Framework Class Library
XPathNodeIterator.GetEnumerator Method

Note: This method is new in the .NET Framework version 2.0.

Returns an IEnumerator object to iterate through the selected node set.

Namespace: System.Xml.XPath
Assembly: System.Xml (in system.xml.dll)

Syntax

Visual Basic (Declaration)
Public Overridable Function GetEnumerator As IEnumerator
Visual Basic (Usage)
Dim instance As XPathNodeIterator
Dim returnValue As IEnumerator

returnValue = instance.GetEnumerator
C#
public virtual IEnumerator GetEnumerator ()
C++
public:
virtual IEnumerator^ GetEnumerator ()
J#
public IEnumerator GetEnumerator ()
JScript
public function GetEnumerator () : IEnumerator

Return Value

An IEnumerator object to iterate through the selected node set.
Exceptions

Exception type Condition

InvalidOperationException

An attempt was made to move the XPathNodeIterator object after the GetEnumerator method was called, or after a For Each loop over the XPathNodeIterator object has begun.

Remarks

The enumerator is positioned on the current position of the XPathNodeIterator object. As the enumerator is moved, the XPathNodeIterator object is moved.

Platforms

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Framework

Supported in: 2.0
See Also