All,
Some time ago, there was a question asked about Apache SOAP and the Oracle XML
parser's DOM implementation. Apache SOAP following its interpretation of the
DOM spec, in that a node without a namespace would have a value of null for the
namespaceURI property. Oracle, as Microsoft has chosen to do with .NET,
instead returns an empty string when there is no namespace.
Rather than simply change the Apache SOAP code, I sent an e-mail to the W3C DOM
working group, asking them to change the DOM 3 spec, which is in progress, to
clarify the issue, e.g. to specify whether or not an empty string is not an
appropriate return value.
Below is the first reply from a committee member. It is not a direct
clarification of what should be returned for the namespaceURI property, but it
does change from "implementation dependent" the guidelines for how to handle an
empty string passed as a namespaceURI to other methods in the API, namely that
the implementation should convert it to null.
Even without clarification from W3C, I continue to hope that Oracle will change
its implementation.
Scott Nichol
----- Original Message -----
From: "Philippe Le Hegaret" <plh@xxxxxx>
To: "Scott Nichol" <scottnichol@xxxxxxxxxxx>
Cc: "WWW DOM" <www-dom@xxxxxx>
Sent: Thursday, August 28, 2003 1:16 PM
Subject: Re: Node.namespaceURI
On Fri, 2003-07-25 at 11:20, Scott Nichol wrote:
>
>
> 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.
>
> 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.
>
> I would like to see DOM 3 Core clarify or amend the statement "The namespace
> URI of this node, or null if it is unspecified". If implementations
> returning empty strings are to be considered out-of-spec, please specify this
> explicitly. If returning a zero-length string is an acceptible
> implementation according to the standard, please state this. If this issue
> is clarified elsewhere in the DOM 3 spec, please refer to that place from the
> description of Node.namespaceURI.
We clarified the XML Namespaces section and replace the sentence in the
3rd paragraph with the following one:
[[
In programming languages where empty strings can be differentiated from
null, empty strings, when given as a namespace URI, are converted to
<code>null</code>.
]]
A link has been added from Node.namespaceURI to the XML namespaces
section.
Philippe
|