tags:

views:

87

answers:

0

The XML im trying to parse contains a control character 0x2 inside CDATA. I tried to replace it with character reference which led to CDATA looking like:

CDATA section----charcter reference----CDATA section

Now if i try to parse it i get an error message saying: org.xml.sax.SAXParseException: Content is not allowed in prolog.

The original xml looked like:

<?xml version="1.1" encoding="UTF-16"?><CELL><![CDATA[ABCD&#2;EFGH]]></CELL>

I modified it to:

<?xml version="1.1" encoding="UTF-16"?><CELL><![CDATA[ABCD]]>&#2;<![CDATA[EFGH]]></CELL>