SAX: String Internalisation and a CORBA/DCOM Question
tbray at textuality.com
Sun Apr 19 23:23:56 BST 1998
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);
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.
>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
xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo at ic.ac.uk the following message;
To subscribe to the digests, mailto:majordomo at ic.ac.uk the following message;
List coordinator, Henry Rzepa (mailto:rzepa at ic.ac.uk)
More information about the Xml-dev