[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: SAXException, checked, buy why?


why saxexception comes
* Karl Waclawek <karl@w...> [2005-01-03 11:37]:
> Alan Gutierrez wrote:
> 
> >>What makes this different from the ErrorHandler interface
> >>already specified in SAX?


> >    public interface ErrorHandler {
> >        public void error(SAXParseException exception)
> >            throws SAXException;
> >        public void fatalError(SAXParseException exception)
> >            throws SAXException;
> >        public void warning(SAXParseException exception)
> >            throws SAXException;
> >    }

> >    It is meant to respond to errors in parse, not errors in content
> >    handling. If content handler authors were to adopt it for use as
> >    a means to intercept genral errors, they'd be going against the
> >    documented use.

> >    http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html

> I am not sure the docs really exclude its use in content handlers,
> they just don't mention it. But they also don't mention that the
> source for content handler events could be something other than a
> SAX parser, in which case the question comes up whether one is
> allowed to use ErrorHandler, and where to register its instance.

> It might be more a question of underspecification than a question
> of prohibited use?

    What if the type of error is not a SAXParseException? I'm
    already feeling uncomfortable calling everything a SAXException.
    
    The method signatures seem to drive home the talk of the parser
    calling the handler.
    
    Also, SAX is simple, and mature. By now the docs should have
    fleshed out. The omission is what I'd like to go by.
    
    I'd have to assume that enough of the other filter/handler
    authors take the same interpretation and that ErrorHandler is
    not going to give me the chance to rectify an error during an event. 

    I'm thinking that the filtering concept was not designed into
    the original SAX, and that error interception was not considered.

    (Many SAX content handlers I've used connect directly to the
        parser and serialize, build a document, etc. So this is
        probably enough for that soft of application, and SAX filtering
        is the sort of thing that folks expect to be a one off.)

    Still, you seem to feel that an error observer is the way to go,
    for interception of errors in the event stream, when your using
    someone else's content handler or content filter.

--
Alan Gutierrez - alan@e...

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.