Skip to main content

XMLStreamException and XMLEventReader

2 replies [Last post]
Joined: 2006-06-17
Points: 0

Hello, I wonder the opinion on error handling within stax api.

XMLEventReader exposes interface like Enumeration {nextEvent(); hasNext()} Call to nextEvent() may produce XMLStreamException.

Suppose you aren't interested in particular element where exception happened. Is that possible to continue stream processing after such a circumstance happened?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-02-23
Points: 0

i've same problem, any response?

Joined: 2011-03-25
Points: 0

The XmlStreamException allows access to the Location where the problem happend. Because the exception is thrown due to bad xml is it does not make sense to continue processing. This would only propagate errors, the producer must fix it !. Less severe errors can be accessed by customizing XMLReporter.