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

Re: SAX: String Internalisation and a CORBA/DCOM Question

  • From: Tim Bray <tbray@t...>
  • To: Xml-Dev List <xml-dev@i...>
  • Date: Sun, 19 Apr 1998 14:22:31 -0700

internalisation
At 12:28 PM 4/19/98 +0700, James Clark wrote:
>> Here's another last-minute SAX question: should org.xml.sax.Parser
>> expose a method for internalising strings?
>> 
>>   public abstract String intern (String s);
>
>Absolutely not.

I'm with James that the complexity is past the SAX 80/20 point for now.

>Doing lots of comparisions on the type of each element whether using
>equals or == is not a good way to write an efficient application.  

For what it's worth, while I agree that this shouldn't go in, I am not
convinced by James' argument here; I think the technique of having
effectively interned all the element/attribute names allows for 
an elegant and minimal design in all sorts of applications, particularly
the lightweight ones that would want to use a stream interface.

>It's
>typically better to have a hash-table that associates each element type
>with either an integer (which you can then use in a switch statement) or
>an object (which you then make a method call on).

I think that if you're getting into an application of the class where
this type of machinery starts to pay for itself, there's a good chance
that you're going to be happier with a DOM/Tree API rather than SAX
anyhow. -Tim


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/
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.