Re: XHTML attributes and namespace, clarification needed

Daniel Glazman wrote:
> Bjoern Hoehrmann wrote:
>> requirement has been avoided. Or is your question why the XML Namespaces
>> specification does not consider attributes without prefix to be in the
>> namespace of the element they are attached to?
> 
> I am maybe naive but it seems to me natural to make the foo attribute in 
> <bar
> foo="truc"> inherit its namespace from the element that carries it. And foo
> would have no namespace if bar has not namespace.
> I understand perfectly why we need namespaceless elements and 
> attributes. But
> I don't feel XHTML attributes fall into that case. XHTML user agents 
> recognize
> XHTML attributes as defined by the XHTML language, they act as if they were
> belonging to the XHTML namespace. Keeping XHTML attributes namespaceless 
> means
> a semantic hack in user agents:

No it doesn't. Attributes are things that float in space, they're 
attributes of something (hence the name). There is no need for them to 
have namespaces, except for the rarer case of attributes that apply in 
the same way irrespective of the element (eg xml:id).

Also, changing the namespace rules for XHTML would pretty much defeat 
the point of the "X" there.

-- 
Robin Berjon

Received on Tuesday, 14 December 2004 13:58:19 UTC