[jdom-interest] Re: Finding the DTD

Brett McLaughlin brett.mclaughlin at lutris.com
Tue Sep 5 07:40:12 PDT 2000


Aidan Killian wrote:
> 
> Hi,
> 
>         I have a slightly more complex version of this problem.
> Typically I recieve XML files with the following DOCTYPE
> statement:
> 
> <!DOCTYPE FpML PUBLIC "-//FpML//DTD Financial product Markup Language
> (1-0))//EN">
> 
>         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.

-Brett

> 
> 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:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

-- 
Brett McLaughlin, Enhydra Strategist
Lutris Technologies, Inc. 
1200 Pacific Avenue, Suite 300 
Santa Cruz, CA 95060 USA 
http://www.lutris.com
http://www.enhydra.org



More information about the jdom-interest mailing list