Interface XMLEventIterator

All Known Subinterfaces:
All Known Implementing Classes:
EventIterator, Xerces2

public interface XMLEventIterator

An interface for iterating XML events. Even though this interface only contains a single method for iterating XML events, higher level constructs can be written on top of this interface to provide more powerful iteration capability. However, the nextEvent method can always be used by applications for complete access to the event stream.

Typically, the application will use the iteration method(s) on the XMLPullParser. But this interface can also be used to construct any type of event iterator, even one not based on parsing XML streams.

Note: Currently, the XMLEventIterator interface only contains the single, low-level nextToken method for iterating XML events. The EventIterator utility class is provided to handle this shortcoming. As this API progresses, it is believed that additional methods will be added to the XMLEventIterator interface. However, this will be decided by actual users of the API. Please let me know if you have any suggestions or comments.

$Id:,v 1.2 2003/01/28 20:00:30 andyc Exp $
Andy Clark

Method Summary
 XMLEvent nextEvent()
          Returns the next event in the document or null if there are no more events.

Method Detail


public XMLEvent nextEvent()
                   throws org.apache.xerces.xni.XNIException,
Returns the next event in the document or null if there are no more events. This method will return one and only one event if it is available; it will never return an event chain (i.e. an event with a non-null next field).

org.apache.xerces.xni.XNIException - Any XNI exception, possibly wrapping another exception. - An IO exception from the parser, possibly from a byte stream or character stream supplied by the parser.

(C) Copyright 2002-2004, Andy Clark. All rights reserved.