[jdom-interest] Re: Finding the DTD
brett.mclaughlin at lutris.com
Tue Sep 5 07:40:12 PDT 2000
Aidan Killian wrote:
> I have a slightly more complex version of this problem.
> Typically I recieve XML files with the following DOCTYPE
> <!DOCTYPE FpML PUBLIC "-//FpML//DTD Financial product Markup Language
> A System Identifier string ("FpML-1.0.dtd") may follow the public
> identifier. This is quite a common situation in the SGML world that is
> addressed by the Oasis Open Catalog standard.
> When using Xerces I use the EntityResolver interface:
> public class Catalog implements EntityResolver
> public InputSource resolveEntity (String publicId, String systemId)
> // ...
> return new InputSource(new FileReader(DTDpath));
> I do not believe the build(InputStream, String) method solves
> this problem. (B.T.W. I only know how to implement this in Xerces and
> XML4J 1.x; I am not sure if other parsers even support entity mapping).
> Great work; I really like JDOM.
There is now a setEntityResolver() method on SAXBuilder where you can do
exactly what you mention above. That will work for you, correct? It's in
the latest CVS version.
> Best regards,
> Aidan Killian (ConcordiaNet Inc.)
> > Message: 10
> > Date: Mon, 04 Sep 2000 22:50:01 +0200
> > From: Jason Hunter <jhunter at collab.net>
> > To: "Muhle, Daniel" <Daniel.Muhle at mettenmeier.de>
> > CC: "'jdom-interest at jdom.org'" <jdom-interest at jdom.org>
> > Subject: Re: [jdom-interest] Finding the DTD
> > > SAXBuilder builder = new SAXBuilder();
> > > Document doc = builder.build(in);
> > >
> > > I get an FileNotFoundException, because the parser tries to
> > > find the DTD in a directory relative to
> > > the directory, the Webserver is started from.
> > That's why there's a build(InputStream, String) method.
> To control your jdom-interest membership:
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc.
1200 Pacific Avenue, Suite 300
Santa Cruz, CA 95060 USA
More information about the jdom-interest