I took over the maintenance of an application that uses the stax parser to split the XML file of many records into separate records for further processing. Using this type of parser for this purpose is redundant in my opinion, but I did not write it.
The application now encounters data such as:
<name><![CDATA[A & B]]></name>
Our current parser returns an event for the begin 'name' tag. The next event is a symbol event with the values "A and B".
From the Sun webpage, I found this:
CDATA Event Reporting Javax.xml.stream.XMLStreamReader, implemented in an XML streaming parser, does not report CDATA events. If you have an application that should receive such events, configure XMLInputFactory to set the following report-cdata-event event-property for a particular implementation:
XMLInputFactory factory = XMLInptuFactory.newInstance();
factory.setProperty("report-cdata-event", Boolean.TRUE);
The analyzer used does not support the "report-cdata-event" property.
I want to find a parser that will report this event, so I don’t need to check every piece of text for characters that should be protected by the CDATA construct.
UPDATE:
After posting this question, I looked at some of the related questions and mentioned the isCoalescing property; The record is set to FALSE.