Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Parsing XML with DTD residing in jar file

843834Oct 19 2001 — edited Apr 8 2003
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 6 2003
Added on Oct 19 2001
4 comments
404 views