Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

An invalid XML character (Unicode: 0xc)

843834Jun 28 2001 — edited Jun 28 2001
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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 26 2001
Added on Jun 28 2001
2 comments
698 views