Re: SAXException, checked, buy why?
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!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format