XPath Iterators

When the XPath expression originates a node-set, the navigator object always returns it using a new breed of object—the node iterator. The node iterator is a relatively simple object that provides an agile, common interface to navigate an array of nodes. The base class for XPath iterators is XPathNodeIterator.

The node iterator does not cache any information about the identity of the nodes involved. It simply works as an indexer on top of the navigator object that operated the XPath query. All the functionalities you might find in the implementation of any XPathNodeIterator classes could have been easily packed into the navigator itself. Why then does the .NET Framework provide the navigation and the iteration API as distinct ...

Get Applied XML Programming for Microsoft® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.