[Home] [By Thread] [By Date] [Recent Entries]

  • To: xml-dev@l...
  • Subject: Re: Re: [Sax-devel] Showstopper issue with new Attribute text
  • From: Miles Sabin <miles@m...>
  • Date: Wed, 17 Mar 2004 21:12:41 +0000
  • In-reply-to: <20040317204435.GI29558@s...>
  • References: <OF24BFF179.96E54E23-ON85256E54.0050C5B0-85256E54.0051D5E1@c...> <200403171940.42291.miles@m...> <20040317204435.GI29558@s...>
  • Sender: Miles Sabin <miles@m...>
  • User-agent: KMail/1.6

jcowan@r... wrote,
> What's important, IMHO, is that all namespace attributes use the
> magic namespace name so that it's easy to uniformly ignore them.

Agreed.

> > Returning null could break a lot of perfectly reasonable code. The
> > empty string (or maybe even a non-empty but non-NCName string like
> > "*") would be a better choice.
>
> I agree that the empty string is the Right Thing.

Hmm ... how about Less Wrong ;-)

I'm slightly worried that there might be code which assumes (not 
unreasonably) that,

  attrs.getLocalName(0).length() > 0

hence that, eg.,

  attrs.getLocalName(0).charAt(0)

can't fail, or that,

  foo.startsWith(attrs.getLocalName(0))

won't be true for all values of foo. Using "xmlns" for the local part 
(ie. option c) fixes this, but could be misinterpreted as a vanilla 
NCName. Something like "*" wouldn't have that problem (which isn't to 
say that it wouldn't have other worse problems).

Cheers,


Miles

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member