I receive the following exception and stack trace when I parse a particular
xml document:
org.xml.sax.SAXParseException: Character reference "" 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
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]