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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: SAX Proposal: new AttributesBuilder interface

[ Lists Home | Date Index | Thread Index ]
  • From: James Strachan <james@metastuff.com>
  • To: John Cowan <jcowan@reutershealth.com>
  • Date: Thu, 09 Nov 2000 09:43:59 +0000

----- Original Message -----
From: "John Cowan" <jcowan@reutershealth.com>
> The trouble with this scheme is that it blocks a very common
> 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


James Strachan
email: james@metastuff.com
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.


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

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