[jdom-interest] Possible BUG in XercesErrHandler class

Brett McLaughlin brett at newInstance.com
Mon Jan 22 16:10:38 PST 2001


Actually, I think it is best as it is. For novices, they can just trap one,
API-neutral exception (IOException). For folks like you who want more, you
can set your own error handler, giving you as much control as needed. Do you
disagree?

-Brett

> -----Original Message-----
> From: jdom-interest-admin at jdom.org
> [mailto:jdom-interest-admin at jdom.org]On Behalf Of Jason Hunter
> Sent: Monday, January 22, 2001 2:04 PM
> To: Govy Munamala
> Cc: jdom-interest at jdom.org
> Subject: Re: [jdom-interest] Possible BUG in XercesErrHandler class
>
>
> Any behavior is fine from my perspective.  This should only affect
> someone building a JDOM tree from a file/stream/url using DOMBuilder,
> which should be no one since SAXBuilder is a much faster way to do such
> a build.
>
> Brett, you wrote the code.  Do you have a preference?
>
> -jh-
>
> Govy Munamala wrote:
> >
> > But the exceptions are already classified as Fatal, Warning and regular
> > errors. The "#ELEMENT# must be declared " exception is being raised as a
> > recoverable error within Xerces and thus being handed over to the error
> > method in XercesErrHandler. Even the
> org.xml.sax.helpers.DefaultErrHandler
> > class is having no op for the methods warning & error.
> >
> > Is there any other solution to identify the type of exception within the
> > programs, because as it stands we cannot introspect the IOException  for
> > these ignorable exceptions.
> >
> > If the design decision is to notify every exception, then the fine
> > granularity of the exceptions should be delegated to the
> calling programs
> > for appropriate action instead of flattening it into a generic
> IOException.
> >
> > Thanks
> > Govy
> > >From: Jason Hunter <jhunter at collab.net>
> > >To: Govy Munamala <govym at hotmail.com>
> > >CC: jdom-interest at jdom.org
> > >Subject: Re: [jdom-interest] Possible BUG in XercesErrHandler class
> > >Date: Sun, 21 Jan 2001 21:56:31 -0800
> > >
> > >I see.  Yes, we rethrow the exceptions because we don't want to ignore
> > >errors.  One could argue we don't have to rethrow a warning, but since
> > >DOMBuilder should only be used for building from existing DOM
> trees, any
> > >warning there should be noted.
> > >
> > >-jh-
> > >
> > >Govy Munamala wrote:
> > > >
> > > > XercesErrHandler is a private class inside
> > > > org.jdom.adapters.XercesDOMAdapter class. So it belongs to JDOM
> > >namespace.
> > > > Sorry for the confusion..
> > > >
> > > > Thanks
> > > > Govy
> > > >
> > > > >From: Jason Hunter <jhunter at collab.net>
> > > > >To: Govy Munamala <govym at hotmail.com>
> > > > >CC: jdom-interest at jdom.org
> > > > >Subject: Re: [jdom-interest] Possible BUG in XercesErrHandler class
> > > > >Date: Fri, 19 Jan 2001 17:43:25 -0800
> > > > >
> > > > >Sounds like a question for Xerces, unless I misunderstand.
> > > > >
> > > > >-jh-
> > > > >
> > > > >Govy Munamala wrote:
> > > > > >
> > > > > > Hello Everyone..
> > > > > >
> > > > > >     I am using JDOM-B5 and Xerces v1.2.3 and found that
> validation
> > >of my
> > > > >XML
> > > > > > doc using XML/Schema was giving an exception %ELEMENT% must be
> > > > >declared..
> > > > > >
> > > > > >     I did a little bit of search for similar messages
> in the archive
> > >and
> > > > > > couldn't find a resonable answer. So I started
> debugging the source
> > > > >code.
> > > > > >
> > > > > >     I found that the methods error & warning in XercesErrHandler
> > >class
> > > > >are
> > > > > > re-throwing the SAXException. The documentation says,
> the call backs
> > >to
> > > > > > these methods could be ignored in most of the cases! I
> also found
> > >that
> > > > > > org.xml.sax.helpers.DefaultErrHandler ignored the
> exceptions in the
> > > > >methods
> > > > > > error & warning. Was there any specific design decision
> involved in
> > > > > > re-throwing the Exceptions??
> > > > > >
> > > > > >     Am I missing something else here???
> > > > > >
> > > > > > Thanks
> > > > > > Govy
> > > > > >
> > > > > >
> _________________________________________________________________
> > > > > > Get your FREE download of MSN Explorer at
http://explorer.msn.com
> > > > >
> > > > > _______________________________________________
> > > > > To control your jdom-interest membership:
> > > > >
> > >
> >
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourho
st.com
> > > >_______________________________________________
> > > >To control your jdom-interest membership:
> > >
> >
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourho
st.com
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.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