Asynchronous Parsing Using Aalto: Handling Errors

Overview

This article demonstrates how to handle parsing related errors during asynchronous StAX parsing using Aalto.

Create employee.xml as shown below.

Note that the end tag for ‘salary’ element is incorrect (see line 4 below).

Create TestAsyncParsingError class as shown below.

The parsing is done using wrapper class (see
this article
for further details).

Catch parser related exception (see line 55-57 below).

The output of the program demonstrating parsing related exception is shown below (see line 19-20 below).

Download Source Code for this Program

Leave a Comment