You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Larry Kline <la...@epropose.com> on 2001/10/18 03:11:29 UTC

Invalid XML character

I receive the following exception and stack trace when I parse a particular
xml document:

org.xml.sax.SAXParseException: Character reference "&#x14;" is an invalid
XML character.
	at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
	at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocume
ntScanner.java:579)
	at
org.apache.xerces.framework.XMLDocumentScanner.scanCharRef(XMLDocumentScanne
r.java:1852)
	at
org.apache.xerces.framework.XMLDocumentScanner.scanAttValue(XMLDocumentScann
er.java:496)
	at
org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocumentScanne
r.java:1769)
	at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1182)
	at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:381)
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
...

The offending character is definitely in the file.  It is in the value of
an element attribute.  The file was written by using a SAX serializer and
standard SAX api calls to create elements and add attributes.  The file has
never been edited directly.  For that reason I don't understand how the
parser could have a problem reading it.

I originally accepted the defaults for encoding, but I have also tried
UTF-16 and UTF-16BE.  Same problem in all cases.

Any thoughts?

- Larry
Larry Kline
larry.kline@epropose.com

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: Invalid XML character

Posted by Julian Reschke <ju...@gmx.de>.
Character code 14 is not allowed in XML content. So the component that
produced it is buggy.

> -----Original Message-----
> From: Larry Kline [mailto:larry.kline@epropose.com]
> Sent: Thursday, October 18, 2001 3:11 AM
> To: xerces-j-user@xml.apache.org
> Subject: Invalid XML character
>
>
> I receive the following exception and stack trace when I parse a
> particular
> xml document:
>
> org.xml.sax.SAXParseException: Character reference "&#x14;" is an invalid
> XML character.
> 	at
> org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1196)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError
> (XMLDocume
> ntScanner.java:579)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner.scanCharRef(XMLDocu
> mentScanne
> r.java:1852)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner.scanAttValue(XMLDoc
> umentScann
> er.java:496)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner.scanElement(XMLDocu
> mentScanne
> r.java:1769)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.d
> ispatch(XM
> LDocumentScanner.java:1182)
> 	at
> org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocume
> ntScanner.
> java:381)
> 	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1081)
> ...
>
> The offending character is definitely in the file.  It is in the value of
> an element attribute.  The file was written by using a SAX serializer and
> standard SAX api calls to create elements and add attributes.
> The file has
> never been edited directly.  For that reason I don't understand how the
> parser could have a problem reading it.
>
> I originally accepted the defaults for encoding, but I have also tried
> UTF-16 and UTF-16BE.  Same problem in all cases.
>
> Any thoughts?
>
> - Larry
> Larry Kline
> larry.kline@epropose.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org