Hello I am parsing xml-files that have a doctype-declaration with the name of their (system) dtd written into.
Usually I have to specify in the doctype-declaration the relative path of the dtd if I want it to be found by the DOMParser. Instead we want this dtd to be found automatically in the classpath like it can be done with .properties-files in java using ClassLoader.getSystemResource. This is the fcode fragment how we implmented this behaviour in the moment: URL dtdURL = ClassLoader.getSystemResource( dtdName ); inputSource.setSystemId( dtdURL.toString( ) ); parser.parse( inputSource ); Our problem is know, that the variable "dtdName" must be known before the document is parsed, i.e. the dtd for our xml-files has to be written in the doctype-declaration of our xml-files plus in the code parsing this xml. One solution to evoid this would be to read the xml-file before the parsing to extract its dtd-name using FileReaders etc.. Is their any other solution to get this behaviour, maybe to tell the DOMParser to search for the dtd in the classpath or a specified directory or a jar-file? Thanks for any response Torben -- ing. Torben Wedekind | Smarten - Junior Architect | Research and Development Dept. /_ _/_ E-Mail | via della Camilluccia 693 / /_/__\ [EMAIL PROTECTED] | I-00135 ROMA Voice +39-06-33435-756 | Fax +39-06-36290974 | WWW http://www.smarten.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]