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

RE: String interning (WAS: SAX2/Java: Towards a final form)

  • From: Tim Bray <tbray@t...>
  • To: xml-dev@i...
  • Date: Thu, 13 Jan 2000 11:36:15 -0800

use of intern in java
At 06:04 PM 1/13/00 -0000, Miles Sabin wrote:
>Anyhow, maybe the waters are getting a bit muddied. I'm
>assuming that all parsers will do interning of one sort or
>another internally. The issue for me is how much of that gets
>exposed via the SAX API. I don't want java-interning exposed,
>because that means my parser has no option but to use

Yes.   Given that *every* credible parser does this, and that it's
a major convenience for programmers using the API to be able to compare
strings with ==, there is at some level an argument that we ought to
expose this fact.

I'd go further; based on having written a parser, it seems to me that
the only sane tactic is for the parser to use java.intern(), but only
once for each unique name, with some sort of internal char[] or
equivalent table.  If this is true, it's an even stronger argument for 
just saying "element types and attribute names coming out of the
parser are intern()ed, period".  

However, I would be totally against making this an optional feature
that the parser can decline to support, because then the value-add 
to the SAX customer goes down the toilet IMHO.

>But I'd much prefer it if the SAX API didn't expose any
>interning behaviour at all. I think we agree on that?

I think we're *arguing* about that... I don't detect agreement yet. -T.

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/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions now closed in preparation for transfer to OASIS.


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.
First Name
Last Name
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.