[jdom-interest] Crimson and DTD resolution

Fred Clewis clewisf at us.ibm.com
Tue Jul 31 10:58:50 PDT 2001


I typically have a lot of xml such the OAG example below that reference
their DTD as:

     <!DOCTYPE SYNC_CUSTOMER_005 SYSTEM "007_sync_customer_005.dtd">

The convention is to access the file in the current directory and not
complicate the portability of the file with references such as
"file:///C:/exactdirectory/...".

Xerces/JDOM did not have a problem with the implicit reference above, but
Crimson/JAXP/JDOM fails to find it and gives:

Root cause: org.xml.sax.SAXParseException: Relative URI
"007_sync_customer_005.dtd"; can not
be resolved without a document URI.
        at java.lang.Throwable.<init>(Throwable.java:96)
        at java.lang.Exception.<init>(Exception.java:44)
        at org.xml.sax.SAXException.<init>(SAXException.java:78)
        at org.xml.sax.SAXParseException.<init>(SAXParseException.java:84)
        at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3035)
        at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3029)
        at
org.apache.crimson.parser.Parser2.parseSystemId(Parser2.java:2627)
        at
org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2605)
        at
org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1116)
     ..............................
Do I have a misunderstanding of how this should work or is this one of the
costs of the 50% smaller footprint?

thanks,




More information about the jdom-interest mailing list