[XML-SIG] SAX: Names with no namespace
Guido van Rossum
Tue, 20 Feb 2001 09:55:41 -0500
> > We had a discussion earlier about how to represent the namespace URI
> > of names that are not in any namespace, and this discussion was never
> > properly concluded.
> I thought it was.
> > The alternatives seem to be None and '', and the question is which to
> > choose. I see that the Java version of SAX has chosen '', but I think
> > this is in large part because anything else would be very inconvenient
> > because of the way Java and Java SAX are put together.
> > Personally, I am leaning toward None, since that seems to me the best
> > way to represent a missing namespace URI. That is also my only
> > argument in favour.
> Well, in the end I don't think there was a single dissention against "None",
> so I'd call it a group Pronouncement.
> For those looking for these threads in the archive, note that it
> came up twice recently. Look for the "DOM documentation update"
> subject line back in November/December and the "problem with empty
> namespace uri" subject in January.
Which reminds me. I've been told that getAttribute() and
getAttributeNS() are supposed to return "" for a non-existent
attribute, and that if you want to know whether the attribute was
really there, you should use getAttributeNode() etc. Again, that may
be a good design for Java or IDL, but is it right for Python? I'd
much rather see None used as it was intended!
--Guido van Rossum (home page: http://www.python.org/~guido/)