We have a JAVA application that pulls the data from SAP system, parses it and renders to the users. The data is pulled using SAP 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 :
- Is there any existing (open source) utility that does this job of replacing illegal characters in XML?
- Or if I had to write such utility, how should I handle them?
- Why is the above exception thrown?
Thank You.