The XMLStreamConstants
interface defines the
int
event codes returned by next()
to tell you what kind of node the parser read.
17 event codes:
XMLStreamConstants.START_DOCUMENT
XMLStreamConstants.END_DOCUMENT
XMLStreamConstants.START_ENTITY
XMLStreamConstants.END_ENTITY
XMLStreamConstants.START_ELEMENT
XMLStreamConstants.END_ELEMENT
XMLStreamConstants.ATTRIBUTE
XMLStreamConstants.CHARACTERS
XMLStreamConstants.CDATA
XMLStreamConstants.SPACE
XMLStreamConstants.PROCESSING_INSTRUCTION
XMLStreamConstants.COMMENT
XMLStreamConstants.ENTITY_REFERENCE
XMLStreamConstants.NOTATION_DECLARATION
XMLStreamConstants.ENTITY_DECLARATION
XMLStreamConstants.NAMESPACE
XMLStreamConstants.DTD
Depending on what the event is, different methods are available on the XMLStreamReader