Aalto StAX Parsing: Entity Reference


This article demonstrates how to parse entity references using Aalto StAX parser.

Note that as of Aalto version 0.9.6, replacing of entity references is not supported. Parsing shall only return the entity reference itself.

Create employee.xml as shown below.

Note that an entity reference ‘entity-reference1’ is used for address element (see line 5 below)

Create TestEntityReference as shown below.

Set the property
as false (see line 17 below).

Get the parsed value of entity reference using
(see line 29 below).

The output of the program demonstrating parsing of entity reference is shown below.

In particular note the entity reference in output (see line 8 below)

Download Source Code for this Program

Leave a Comment