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

Re: SAXException, checked, buy why?


Re:  SAXException


Alan Gutierrez wrote:

>>It may be Java-oriented because I don't understand the problem.
>>Speaking for the Python case, since you don't have to declare
>>exceptions, the handler can throw anything it pleases, which, if not
>>handled by the driver falls to the original parse-calling code.
> 
> 
>     I'm not Python-oriented, so I might be making hash of this
>     response, but I think this is a generic concern.
> 
>     Assume no checked exceptions. That is some Java hand-wringing
>     that I'll discuss with Java developers if they are interested.
>     
>     <java-specific-musing boring-for="Uche">
<snip>
>     </java-specific-musing>
>         
>     How do you provide the fellow who invokes the event conduit with
>     a means to intercept exceptions at the event handler?
>     
>     Say I've a content handler that likes to open files. The action
>     to take when a file is not found could be to skip it an move on,
>     or it could be that the file can be fabricated real quick, or it
>     could be that processing has to abort via an exception.
>     
>     This is an application descision. How does the application
>     developer configure the content handler so that the exceptional
>     condition is handled during the event?

I am not sure I understand this question, as the answer I am thinking
of is trivial:

A SAX event handler can handle exceptions thrown by the calls it makes.
Or it can let them escape. Depends on whether it wants to "notify"
the event generator or not. How is that not possible in Java?

Apart from the above, consider the case of a chain of content handlers
(a "pipeline"). If one link in the chain throws an exception, the links
that are "downstream" get no notification at all (if they are even called)
as one does not "bubble" exceptions down. Each of the downstream
handlers might throw another exception. Maybe in that case event
handlers should avoid throwing exceptions at all, and rather
notify an error handler.

Karl


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.