SAX, Java, and Namespaces (was Re: Restricted Namespaces for XML)

David Megginson david at
Thu Feb 4 23:56:16 GMT 1999

Tyler Baker writes:

 > If SAX were to make a simple requirement that all strings that
 > represent symbols (like names) were to be interned then things
 > would be a lot cheaper.  The same can be said of the DOM as well.

The problem is that Java's own intern is so terribly inefficient that
no serious parser writer will use it (most of them have their own,
custom interns).

Even then, you wouldn't get any help with the "xmlns:" prefix
matching, which is the costliest part.  The most efficient way to do
namespace processing is directly in the parser (which has to look at
every attribute name anyway), but my own tests have shown that filter
layer on top of SAX isn't too bad.

All the best,


David Megginson                 david at

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list