Aalto StAX Parsing: Empty Element


This article demonstrates how to to verify whether an element is empty or not using Aalto StAX parser.

Create employee.xml as shown below.

Keep the address element empty (see line 4 below).

Create TestVerifyEmptyElement class as shown below.

For the ‘address’ element (see line 21 below), use
method to verify whether the element is empty (see line 23 below).

The output of the program demonstrating the verification of empty element is shown below.

Download Source Code for this Program

Leave a Comment