We have launched a free Basic Kubernetes Course. Click here to enrol now! Kubernetes is a container orchestration platform used by enterprises worldwide and Kubernetes developers are in high demand!
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
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).