Fw: Node.namespaceURI

"Scott Nichol" <[email protected]>
Newsgroups gmane.text.xml.soap.user,gmane.text.xml.soap.devel
Message-ID <01b001c352c7$25b27dd0$6401a8c0@northgate>
Based on some interest expressed in having Apache SOAP support the Oracle convention of having Node.namespaceURI return an empty string instead of null when there is no namespace, I posted to [email protected] about whether the spec should further clarify what is meant by "null".  This is the only response to date.

Scott Nichol


----- Original Message ----- 
From: "Fred L. Drake, Jr." <[email protected]>
To: "Scott Nichol" <[email protected]>
Cc: <[email protected]>
Sent: Friday, July 25, 2003 11:37 AM
Subject: Re: Node.namespaceURI


> 
> 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
> 
> -- 
> Fred L. Drake, Jr.  <fdrake at acm.org>
> PythonLabs at Zope Corporation
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.