Re: Namespace of the xmlns Attribute

>    Is the xmlns attribute supposed to be put into the 
> http://www.w3.org/2000/xmlns/ namespace, just like other attributes with 
> the xmlns: prefix, or into no namespace like any other attribute without 
> a prefix?

Most namespace-aware applications (e.g. XSLT) do not make namespace
declarations available as attributes, so for these the question does
not arise.

The Namespaces spec does not really address the question.  The
production [15] (Attribute) distinguishes between namespace
declarations and ordinary attributes, and does not use the QName
production for declarations.  Originally it did not define any
namespace for the xmlns prefix used in declarations, but one was added
in an erratum (http://www.w3.org/XML/xml-names-19990114-errata#NE05),
I believe at the request of the DOM WG.

The Infoset spec on the other hand explicitly states that the namespace
URI of all namespace declaration is http://www.w3.org/2000/xmlns/
(see http://www.w3.org/TR/xml-infoset/#infoitem.element), so the 
implementations you mention are conforming to that.

-- Richard

Received on Monday, 27 November 2006 15:56:52 UTC