OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: SAX2: Exceptions

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: XMLDev list <xml-dev@ic.ac.uk>
  • Date: Tue, 21 Dec 1999 13:43:13 -0500 (EST)

David Brownell writes:

 > David Megginson wrote:
 > > 
 > > 1. SAXException extends IOException.
 > 
 > Not my preferred model ... it _isn't_ an I/O exception, and the
 > recovery mechanisms applicable to I/O problems won't typically
 > apply, or even act reasonably given a data format error (which
 > is what a SAXException basically indicates).
 > 
 > What's the rationale behind this proposal?

Consider higher-level APIs that happen to allow XML input.  It seems
(to me, at least) that the following makes sense:

  public interface Gizmo
  {
    ...
    public void import (String uri) throws IOException;
  }

You don't want to hardwire SAXException into the Gizmo interface,
because it really has nothing to do with the problem domain, and
people may choose to implement other kinds of readers (say, over the
DOM); you could, of course, create a new kind of IOException that
allows a SAXException to be embedded in it, but that hides the fact
that an XML parsing error really is an I/O error for most
applications -- XML's just a high-level read format.


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS