W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2003

Re: Node.namespaceURI

From: Fred L. Drake, Jr. <fdrake@acm.org>
Date: Fri, 25 Jul 2003 11:37:15 -0400
Message-ID: <16161.20139.452275.538723@grendel.zope.com>
To: Scott Nichol <scottnichol@comcast.net>
Cc: www-dom@w3.org

Scott Nichol writes:
 > This regards Node.namespaceURI in the DOM 3 Core.  Going back to
 > DOM 2, this attribute's description has started "The namespace URI
 > of this node, or null if it is unspecified".  To me, this seems
 > quite clear, and in programming languages like Java, I expect a
 > null value in that language to be returned.

For Python, null is mapped to the None value, which is generally used
in Python to indicate "no value".  The Python XML-SIG has gone round
and round on the issue of whether to use an empty string or None for a
missing namespace URI in the DOM, and we finally settled on None since
that's really what's intended.

 > However, there are implementations that do not use what I would
 > consider to be a null.  For example, Oracle's XML parser's
 > Node.getNamespaceURI() returns an empty (zero-length) string, and
 > Microsoft's .NET framework (the NamespaceURI property of the
 > System.Xml.XmlNode class) likewise returns an empty string.

This sounds like a serious nuissance in those implementations.

But I think the spec spells out clearly that null is the right thing.
If that's normally spelled using Java's null value, there's no need to
change the specification; the implementations are clearly in violation
and bug reports should be filed.


Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation
Received on Friday, 25 July 2003 11:37:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:11 UTC