Have an JavaRCP
application that uses JAXB
to generate an XML file, it basically takes input (special characters as well) from textbox to save in xml and display the same by unmarshalling from xml.
User is copying console output (may contain special characters) and pasting in the textbox and saving it into an xml.
xml version="1.0" encoding="UTF-8" jaxb version is 2.1.10 in JDK 1.6_21.
When unmarshalling, receiving an unmarshall exception:
[org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1b) was found in the element content of the document]
There is an invalid XML character found when unmarshalling the xml. I searched this forum for some help and found few links, but neither of them has a resolution or workaround. Can anyone guide me.
I have tried with other encoding types, but with no success. Do I need to replace that character with its equivalent character code before saving/marshalling?
Following are the links which are closer to my problem: Saving an escape character 0x1b in an XML file Invalid Characters in XML