Hi Kevin,

For efficiency Xerces keeps a table of unique strings for XML names
(elements, attributes, entities, etc...) and namespace names (URIs). These
strings have all been interned so unique references for names and
namespace names are passed to the application. SAX has a string-interning
feature that when set to true guarantees that all names are internalized.
In Xerces this feature is always on, so if you're using SAX you can safely
do reference comparison on names. For DOM you need to use String.equals(),
but the first test this method does is check for reference equality, so if
you use string literals (which I believe are already internalized) you can
get the performance benefit there too.

On Mon, 20 Oct 2003, Kevin Klinemeier wrote:

> As for what Xerces "should" be doing, its hard to tell.  To be
> pedantic, the interface doesn't specifically say it will return the
> same reference on multiple calls, so it doesn't have to.  Some caching
> might be nice, but as with all caching you're taking up resources and
> adding complexity.  Maybe it was just easier to make another one.  And,
> you wouldn't want to depend on it anyway.
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to