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

Re: Refactoring SAX 1.0

  • From: andyclar@u...
  • To: David Brownell <db@e...>
  • Date: Thu, 8 Apr 1999 18:17:23 -0600

org.xml.sax.saxparseexception


David,

David Brownell wrote:
> I'm still unclear on what you're suggesting ... suspect I'm
> not alone in it!  Do you have an example, maybe?
>
> Remember that compatibility is a ground rule for everyone.

Yes, I've been thinking a lot about this recently and have
come up with an example of how the SAX 1.0 could be refactored.

First, I looked at the SAX interfaces and classes that are of
general use to all parsers. My list includes the following:

  org.xml.sax.EntityResolver
  org.xml.sax.ErrorHandler
  org.xml.sax.InputSource
  org.xml.sax.Locator
  org.xml.sax.Parser
  org.xml.sax.SAXException
  org.xml.sax.SAXParseException

The EntityResolver, InputSource, and Locator objects can be
used without modification. Because general error handling is
useful to all parsers, I would rename SAXException to
XMLException and do the same for SAXParseException. These
name changes would affect the ErrorHandler callback methods.

I would keep the Parser interface the same except for
removing the callback registration methods (setDTDHandler
and setDocumentHandler) that are specific to a stream based
parser. To enable the stream based parsing functionality, I
would add a SAXParser interface that extends the new Parser
interface to add the callback registration methods.

(I'm not including code examples of what these new interfaces
and classes look like in order to keep this posting short. But
I could post further if there was interest.)

I realize that compatability with SAX 1.0 is very important
to retain. I would suggest keeping the org.xml.sax and
org.xml.sax.helpers packages the same -- don't change them
at all. Nothing would be moved or renamed. In this way,
users of SAX 1.0 would not have to change their code.

The refactored SAX could be moved to new packages. For
example, org.xml and org.xml.sax2. The org.xml package would
contain all of the general purpose interfaces and objects
and org.xml.sax2 would contain the specific SAX objects. The
latter would include all of the SAX2 extensions being
discussed now on the mailing list, as well.

--
Andy Clark * IBM, JTC - Silicon Valley * andyclar@u...



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


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.