Invalid XML Characters
843834Mar 22 2004 — edited Jun 16 2008Anyone know how to get around what are typically considered invalid XML characters? I'm wrapping some of our existing claims transactions in XML, but the existing transactions contain control characters such as unicode 0x1e, 0x1c, 0x1d.
File outputFile = new File( outputFilename );
DOMParser parser = new DOMParser();
// Get the DOM tree as a Document object
parser.parse( xmlDocument );
Document doc = parser.getDocument();
This results in:
[Fatal Error] ClaimTest.xml:9:74: An invalid XML character (Unicode: 0x1e) was found in the element content of the document.
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1e) was found in the element content of the document.
( ... )
Can this be handled with JDOM using CDATA?
Thanks in Advance