Skip to content
Advertisement

Tag: stax

Understanding XMLStreamReader and START_ELEMENT

Consider the following XML file: Why am I not getting a START_ELEMENT event when using XMLStreamReader. Code is (lifted from): Output on my side: Ref: Answer Turns out the documentation has it described: An XMLStreamReader instance is created with an initial event type START_DOCUMENT. So code should instead be: The loop is easier to write using XMLEventReader:

Advertisement