[jdom-interest] How do specify a DTD?
jhunter at acm.org
Fri Nov 15 13:25:34 PST 2002
You can use an EntityResolver, but the easier way is to pass in
something other than a stream. A stream naturally doesn't include
location information but a File does. So pass in the file, and then the
parser can find resolve relative paths.
Kenneth Ellefsen wrote:
> If you have a xml file with a DOCTYPE tag specifying a dtd file, is it
> an absolute requirement that the dtd file must be in the same directory
> as the xml file?
> Or is it possible at run time to tell the builder where the dtd file is
> I tryed the following:
> FileInputStream file = new FileInputStream(m_filename);
> m_doc = builder.build( file, "/path/to/dtdfile/file.dtd")
> But is still fails with an Exception saying:
> External entity not found: "/path/to/dtdfile/file.dtd"
> Tips appreciated.
> Kenneth Ellefsen | Tlf: (+47) 55985829
> Schlumberger Information Solutions | www.sis.slb.com
> To control your jdom-interest membership:
More information about the jdom-interest