Hi,
I have the follow code to parse a file, and my file reference an external DTD ../style/modulesynopsis.dtd like this:
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
....
but I got an Nested exception: org.xml.sax.SAXParseException: Relative URI "../style/modulesynopsis.dtd"; can not be resolved without a base URI.
Could some one please tell me what did I miss?
And How can I switch to use xerces instead of crimson parser?
Thanks for any help
<<<<<<< My code >>>>>>>>>>>>
SAXReader reader = new SAXReader( DOMDocumentFactory.getInstance() );
try {
Document document = reader.read( file.getContents() );
} catch (Exception e) {
}
<< complete Exception >>>
Nested exception: org.xml.sax.SAXParseException: Relative URI "../style/modulesynopsis.dtd"; can not be resolved without a base URI.
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3182)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3176)
at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2758)
at org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2730)
at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1129)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:489)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:442)
at org.dom4j.io.SAXReader.read(SAXReader.java:323)
at org.dom4j.io.SAXReader.read(SAXReader.java:24