Mantis - Resin
Viewing Issue Advanced Details
916 major always 02-06-06 00:35 04-06-06 11:07
closed 3.0.17  
none 3.0.19  
0000916: Caucho's XML parser ignores encoding declaration in a DTD
In our applications, we have XML configuration files that are validated against a DTD, included in the jar of our library.
This DTD is encoded using ISO-8859-1 but upon startup of the application and when the XML parser reads the configuration file, it complains with the following message:
----------------------------------------------------------------------------- [^] illegal u
tf8 encoding at 0xf3
        at com.caucho.xml.readers.Utf8Reader.error(
        at com.caucho.xml.readers.Utf8Reader.readSecond(
        at com.caucho.xml.XmlParser.parseComment(
        at com.caucho.xml.XmlParser.parseDoctypeDecl(
        at com.caucho.xml.XmlParser.parseDoctype(
        at com.caucho.xml.XmlParser.parseNode(
        at com.caucho.xml.XmlParser.parseInt(
        at com.caucho.xml.AbstractParser.parse(
        at com.caucho.xml.AbstractParser.parseDocument(
        at com.caucho.xml.parsers.AbstractDocumentBuilder.parse(AbstractDocument
        at org.leaf.impl.TraxLoader.getDocument(
        ......... // Custom code
Checking the DTD, there are such ilegal UTF-8 characters, but they are valid ISO-8859-1 characters and the declaration of the DTD is
<?xml version="1.0" encoding="iso-8859-1" ?>
so it should not complain. In fact, Caucho's XML parser from versions 2.1.X do not complain, neither does Xerces, which is the parser we are using now due to this problem.

It's been happening since the first version I tested from the 3.X branch and it never happened with the 2.X branch.
You can find the "offending" DTD here:*checkout*/webleaf/resources/org/leaf/util/LEAFwad.dtd [^]

04-06-06 11:07