[jdom-interest] not validating SystemID

Sandro Böhme s.boehme at inovex.de
Mon Oct 8 12:02:36 PDT 2001


Sorry for the confusion, but what I have written was'nt right. The SystemID
was'nt ignored.
I forgot that this time I *had* an internet connection. Thus it looked like
it was ok, but it was'nt.
Of course the right solution is:
       aSAXBuilder.setEntityResolver( new EntityResolver(){
                                    public InputSource resolveEntity(String
parm1, String parm2) throws org.xml.sax.SAXException, java.io.IOException {
                                      return new InputSource(new
StringReader(""));
                                    }
                                  }
                                );
Like described in
http://www.servlets.com/archive/servlet/ReadMsg?msgId=120272&listName=jdom-i
nterest .

Ciao,

Sandro

PS: You have my vote for the FAQ entry! ;-)


----- Original Message -----
From: "Sandro Böhme" <s.boehme at inovex.de>
To: "Jason Hunter" <jhunter at servlets.com>; <brett at newInstance.com>;
<jdom-interest at jdom.org>
Sent: Friday, October 05, 2001 2:34 PM
Subject: Re: [jdom-interest] not validating SystemID


> I have'nt get it running with an EntityResolver because of the following
> Exception:
> org.jdom.JDOMException: Error on line 1 of document
> file:/d:/svg-20000303-stylable.dtd: org.apache.crimson.parser/P-059 [dtd]
> But it does'nt matter because I dont need an InputSource dependent of a
> SystemID. I just dont need a SystemID.
>
> If I wrap the Reader with an InputSource and give that InputSource to the
> build method, than it works fine. The SystemID is ignored.
> (new SAXBuilder(false)).build( new InputSource(  reader  ) );
>
> JavaDoc of the InputSource class desc.:
> "...The SAX parser will use the InputSource object to determine how to
read
> XML input. If there is a character stream available, the parser will read
> that stream directly; if not, the parser will use a byte stream, if
> available; if neither a character stream nor a byte stream is available,
the
> parser will attempt to open a URI connection to the resource identified by
> the system identifier. ..."
> more exactly the JavaDoc of InputSource.setSystemId:
> "...the parser will attempt to open a connection to the URI only if there
is
> no byte stream or character stream specified..."
>
> Thanks for the infos!
>
> Sandro Böhme
>
> ----- Original Message -----
> From: "Jason Hunter" <jhunter at servlets.com>
> To: "Sandro Böhme" <s.boehme at inovex.de>
> Cc: <jdom-interest at jdom.org>
> Sent: Friday, October 05, 2001 12:26 AM
> Subject: Re: [jdom-interest] not validating SystemID
>
>
> > Check out SAXBuilder.setEntityResolver().  That's the trick.
> >
> > -jh-
> >
> > Sandro Böhme wrote:
> > >
> > > Hi,
> > >
> > > is there a way to prevent JDOM from parsing the systemID in the
doctype?
> > > The systemID is a URL to the web. But on parsing time I cannot connect
> to
> > > the web and I do not need to
> > > validate the XML file.
> > > I tried to set the validation of the SAXBuilder to false, but it did
not
> > > solve my problem.
> > > Thanks for any advice you can give me.
> > >
> > > Sandro
> > >
> > > _______________________________________________
> > > To control your jdom-interest membership:
> > >
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
> t.com
> > _______________________________________________
> > To control your jdom-interest membership:
> >
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
> t.com
> >
> >
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>
>




More information about the jdom-interest mailing list