avishosh wrote:
I have a java program that reads it's settings from an .xml config
file with a refernce to a .dtd file but I want to store the .dtd in
the .jar file with the rest of the programs resources.
Anyone know how I'd write a doctype tag for this?
The .jar could be moved around on the server as could the .dtd so I
don't want to write an absolute path in the doctype declaration.
What are you using to parse? If you are using SAX then maybe it is
possible to implement your own org.xml.sax.EntityResolver, at least its
documentation says
If a SAX application needs to implement customized handling for external
entities, it must implement this interface and register an instance with
the SAX driver using the setEntityResolver method.
The XML reader will then allow the application to intercept any external
entities (including the external DTD subset and external parameter
entities, if any) before including them.
--
Martin Honnen
http://JavaScript.FAQTs.com/