Referencing an external DTD

hi,

I am facing problems while trying to parse an XML file, when the correspoding DTD is a jar file resource. I get the following error

org.xml.sax.SAXException: Fatal Error: URI=jar:file:/u/arun/projects/base/jar/c.jar!/config/prices/parser/input.xml Line=2: External entity not found: "jar:file:/u/arun/projects/base/jar/c.jar!/config/prices/parser/../gui/format.dtd".

at deshaw.common.format.parser.XmlParser.fatalError(XmlParser.java:575)

at org.apache.crimson.parser.Parser2.fatal(Parser2.java:3185)

at .....

my xml file URI is

jar:file:/u/arun/projects/base/jar/c.jar!/config/prices/parser/input.xml

the dtd is in the same jar "c.jar", albeit in a different directory "gui"

jar:file:/u/arun/projects/base/jar/c.jar!/config/prices/gui/format.dtd

in input.xml i am trying to reference the dtd as follows

<!DOCTYPE Formats SYSTEM "../gui/format.dtd">

however this relative reference does not work, and throws the above exception. i can't understand why this fails. Can somebody throw more light on this problem, and help me resolve it?

Thanks

arun

[1164 byte] By [asquiz] at [2007-9-18]
# 1
What is the name of your root element? Does it match with your DTD name?
rjamuna at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 2
yeah it does.. That is not the cause of the problem.
asquiz at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 3
As per your question, your XML has <!DOCTYPE Formats SYSTEM "../gui/format.dtd">I think, you should have<!DOCTYPE Format SYSTEM "../gui/format.dtd">and your Root element should also be named as "Format". Does this help?
rjamuna at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...
# 4
no, thatz not the problem.. sorry abt that.. that was actually a mistake in my original post. the Root element is fine.. but i still get the error.
asquiz at 2007-7-4 > top of java,Enterprise & Remote Computing,Enterprise Technologies...