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

Re: SAX Proposal: new AttributesBuilder interface

  • From: James Strachan <james@m...>
  • To: John Cowan <jcowan@r...>
  • Date: Thu, 09 Nov 2000 09:43:59 +0000

Re: SAX Proposal: new AttributesBuilder interface
----- Original Message -----
From: "John Cowan" <jcowan@r...>
> The trouble with this scheme is that it blocks a very common
implementation
> technique.  Since an Attribute object is valid only during a startElement
> callback, there is no reason for a parser to ever instantiate more than
> one such object, and indeed it is common for the SAXParser object to be
> the object in question.

I don't think it does block this technique. The SAX Parser must have at
least one Attributes implementation somewhere to be able to call the SAX
ContentHandler. If a particular SAX Parser wants to keep the same Attributes
object throughout the entire parsing of a document, it can do that by
implementing its own default AttributesBuilder to return the same Attributes
object instance.

e.g. the SAX Parser could implement both the Attributes and
AttributesBuilder interfaces and return "this" in the
AttributesBuilder.createAttributes() method.

It is only in those cases where a SAX user (such as JDOM) wants to override
the AttributesBuilder that new Attributes objects would get created for each
element.

J.

James Strachan
=============
email: james@m...
web: http://www.metastuff.com




If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.

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.