[jdom-interest] How do specify a DTD?
kellefsen at bergen.oilfield.slb.com
Tue Nov 19 00:20:22 PST 2002
m_doc = builder.build( file, "/path/to/dtdfile/file.dtd")
2nd argument is a URI, so of course it has to be
m_doc = builder.build( file, "file:/path/to/dtdfile/file.dtd")
in my case. :)
On Fri, 2002-11-15 at 22:25, Jason Hunter wrote:
> 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:
> > Hi.
> > 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
> > located?
> > 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.
> > --
> > Mvh,
> > Kenneth Ellefsen | Tlf: (+47) 55985829
> > Schlumberger Information Solutions | www.sis.slb.com
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://firstname.lastname@example.org
Kenneth Ellefsen | Tlf: (+47) 55985829
Schlumberger Information Solutions | www.sis.slb.com
More information about the jdom-interest