< issue in AXIOM parser

110 Views Asked by At

Axiom parser converts "&lt ;" to "<" if it is followed by empty node.This makes the xml content invalid.

XML Input:

case 1: <A> test <B></B> &lt; test1 </A>
case 2: <A> test <B>ear</B> &lt; test1 </A>

XML Output:

case 1: <A> test <B/> < test1 </A> [Incorrect]
case 2: <A> test <B>ear</B> &lt; test1 </A> [Correct]

Axiom Code:

InputStream ina = new FileInputStream(fileName);
OMElement root = OMXMLBuilderFactory.createOMBuilder(ina).getDocumentElement();

Is there any way to handle this scenario ?

1

There are 1 best solutions below

0
On

This is AXIOM-509. A fix for that issue was released in Axiom 1.4.0.