XML parsing with SAX | how to handle special characters?
- by cedar715
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 "�" 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.