Namespace declarations in application/xhtml+xml (Re: 3.6. The root element)

On Jul 31, 2007, at 14:05, Ben Boyle wrote:

> Perhaps this is another situation where the "element specific
> attributes" section is insufficient. It might be good to have an
> "XHTML considerations" section which explains that an xmlns is
> required.

The HTML 5 draft is the way it is, because the namespace declarations  
in namespace-aware XML aren't normal attributes after namespace  
processing when XML is modeled properly. The DOM doesn't count as  
modeling namespace-aware XML properly. XOM and SAX, for instance, do  
model namespace-aware XML properly. The Infoset spec tries to find  
some middle ground without pointing out the flaws of the DOM  
outright, but the Infoset still doesn't treat namespace declarations  
as normal attributes.

The HTML 5 draft is written in terms of the DOM, because browsers are  
stuck with it, but when the spec talks about allowed attributes it is  
implied that any element can carry any namespace declarations. It  
would be inappropriate for the spec to restrict where and how  
namespace declarations appear in the XML serialization, since doing  
so would violate the XML layer cake. The spec deals with what to do  
with elements that are in the namespace,  
but how might one express such elements in XML is, strictly speaking,  
out of the scope of the spec.

It would be a good idea to acknowledge this piece of XML lawyerism  

> We should have a new section: "The xmlns attribute" This section
> should given the recommended usage and contain the note about the HTML
> DOM null namespace.

In principle, it is wrong for a spec to spend a lot of prose  
explaining the consequences of its normative references, but in this  
case it might be a good idea considering the nature of Namespaces in  

> We should attempt to clarify the terminology throughout the spec: "in
> HTML" seems ambiguous clear or should it be "in HTML serialisation" or
> "in HTML DOM" or something else ... likewise with (X)HTML or XHTML or
> "XML"


Henri Sivonen

Received on Tuesday, 31 July 2007 12:17:16 UTC