[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: UTF-8 BOM
- From: Michael Brennan <Michael_Brennan@allegis.com>
- To: 'Richard Tobin' <richard@cogsci.ed.ac.uk>
- Date: Thu, 14 Jun 2001 19:22:39 -0700
Well, I recreated the test case I mentioned in an earlier message -- this
time with JAXP 1.1. Sun's parser does not properly deal with a UTF-8 BOM. I
get this exception when trying to load the document:
org.xml.sax.SAXParseException: Document root element is missing.
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3023)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at
org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at
org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
at com.allegis.openlinks.test.GUITester2.main(GUITester2.java:21)
In spite of the misleading error message, the document is well-formed. The
same error message occurs regardless of whether an XML declaration is
present (I got the same error message with both your doc.xml and docx.xml
test cases). The same document without the BOM parses fine.
I believe I recall having problems with Aelfred in the past with this same
issue (I was using the modified Aelfred included in SAXON).