The StAX API exposes methods for iterative, event-based processing of XML documents. The StAX API is bidirectional, enabling both reading and writing of XML documents.The StAX API is really two distinct API sets
1. Cursor API
2. Iterator API
Cursor API
As the name implies, the StAX cursor API represents a cursor with which you can parse an XML document from beginning to end. This cursor can point to one thing at a time, and always moves forward, never backward, usually one element at a time.
The two main interfaces in cursor are
1. XMLStreamReader
2. XMLStreamWriter
Iterator API
The StAX iterator API represents an XML document stream as a set of discrete event objects. These events are pulled by the application and provided by the parser in the order in which they are read in the source XML document.The base iterator interface is called XMLEvent. The primary parser interface for reading iterator events is XMLEventReader, and the primary interface for writing iterator events is XMLEventWriter.
0 comments:
Post a Comment