StaxReader Event Types

Event types of the xml.StaxReader class.

Table 1. StaxReader event types
Type Description XML sample
START_DOCUMENT StaxReader cursor points to the beginning of the XML document. <?xml version="1.0" standalone="no"?>
END_DOCUMENT

StaxReader cursor has reached the end of the XML document.

No additional parsing operation will succeed.

START_ELEMENT StaxReader cursor points to a XML start element or empty element node. <p:elt attr="val"> or <p:elt attr="val"/>
END_ELEMENT StaxReader cursor points to a XML end element node. </p:elt>
CHARACTERS StaxReader cursor points to a XML text node. ... eltA/>This is text<eltB ...
CDATA StaxReader cursor points to a XML CData node. <![CDATA[<Hello, world!>]]>
SPACE StaxReader cursor points to a XML text node containing only whitespaces. ... eltA/> <eltB ...
COMMENT StaxReader cursor points to a XML comment node. <!-- a comment -->
DTD StaxReader cursor points to a DTD string. <!DOCTYPE A [ <!ELEMENT B (C+)> ]>
ENTITY_REFERENCE StaxReader cursor points to a XML entity reference node. &ref;
PROCESSING_INSTRUCTION StaxReader cursor points to a XML processing instruction node. <?target data?>
ERROR StaxReader cursor points to an unexpected XML node.