Hello all...
I am trying to build an XML document from a database query (SQL Server)... using Apache's Xalan/Xerces xml/xsl parser.... and the Xerces keeps throwing this exception:
An invalid XML character (Unicode: 0xc) was found in the element content of the document.
when looking at the content... I do find some unicode characters: ��
My XML header is set to:
<?xml version="1.0" encoding="ISO-8859-1"?>
but it seems to have no influence. I tried (just for troubleshooting) to enclose the field in a
<![CDATA[]]>
block, but it threw the same error.
I am using
org.apache.xerces.parsers.DOMParser
to parse the XML.
My parsing code looks like this:
DOMParser parser = new DOMParser();
parser.parse(new InputSource(new StringReader(xml)));
is there something else I am missing?