Parsing XML with DTD residing in jar file
843834Oct 19 2001 — edited Apr 8 2003Hi,
I have problems using crimson parser for my program under JDK 1.4.0b2. It attempts to parse an xml file with SAX. The corresponding lies in a jar file in a different directory but reachable through the classpath. All I get is an exception.
org.xml.sax.SAXParseException: Relative URI "my.dtd"; kann nicht ohne eine Dokument-URI aufgel�st werden.
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3121)
at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3115)
at org.apache.crimson.parser.Parser2.resolveURI(Parser2.java:2702)
at org.apache.crimson.parser.Parser2.maybeExternalID(Parser2.java:2674)
at org.apache.crimson.parser.Parser2.maybeDoctypeDecl(Parser2.java:1125)
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:433)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:326)
I used Xerces before and it worked fine. I already searched the community for that problem. All hints I found assume that xml file and dtd are in the same directory. Setting the systemId of the input source doesn't fix the problem.
Is there anyone out there knowing what to do?
Thanks,
Thorsten