XML parsing with SAX | how to handle special characters?

Posted by cedar715 on Stack Overflow See other posts from Stack Overflow or by cedar715
Published on 2010-03-18T06:09:38Z Indexed on 2010/03/18 6:11 UTC
Read the original article Hit count: 432

Filed under:
|
|
|
|

We have a JAVA application that pulls the data from SAP, parses it and renders to the users. The data is pulled using JCO connector.

Recently we were thrown an exception:

org.xml.sax.SAXParseException: Character reference "&#00" is an invalid XML character.

So, we are planning to write a new level of indirection where ALL special/illegal characters are replaced BEFORE parsing the XML.

My questions here are : 1. Is there any existing(open source) utility that does this job of replacing illegal characters in XML? 2. Or if I had to write such utility, how should i handle them? 3. Why is the above exception thrown?

Thank You.

© Stack Overflow or respective owner

Related posts about sax

Related posts about xml-parsing