W3C home > Mailing lists > Public > www-style@w3.org > December 2004

Re: XHTML attributes and namespace, clarification needed

From: Laurens Holst <lholst@students.cs.uu.nl>
Date: Wed, 15 Dec 2004 15:08:39 +0100
Message-ID: <41C04567.4020809@students.cs.uu.nl>
To: Robin Berjon <robin.berjon@expway.fr>
CC: www-style@w3.org

Robin Berjon wrote:
>> Hm, well, but I can't find anything in the XML Namespaces document 
>> that explicitly says it is in the 'null' namespace (or I must have 
>> missed it), and I also don't think it makes sense if that weren't the 
>> case.
> "Default namespace declarations do not apply directly to attribute names".
> Therefore, attribute with no prefix implies attribute with no namespace.

That's like saying 'this basket contains no apples, so it must contain 
pears'. Really, this 'therefore' makes no sense at all. Revive your 
predicate logic classes ;p.

Where in that sentence does it say namespaces are NULL (or: 'not in any 
namespace')? It says that DEFAULT namespace declarations (that is, the 
xmlns= somewhere higher in the tree) do not apply DIRECTLY to attribute 
names (in other words, they *can* apply INDIRECTLY).

Let's look at this statement, which directly follows from the line in 
the spec: "Default namespace declarations can apply indirectly to 
attribute names."

I do not see how they in any case can apply indirectly if you make them 
have a null namespace by default (like elements do if there's no default 
namespace set). If they were null by default, that phrase in the spec 
would be false - default namespace declarations do not apply to 
attribute names at all.

However when they inherit their namespace from their element, it makes 
sense. In that case, they indirectly inherit the default namespace if 
the element they're on does not have any specific namespace prefix 

I think this kind of proves that the namespace of attributes can not 
default to null, per spec.

Anyways, this is a line which only indirectly talks about the namespace 
of attributes. If this is the only occurrance where the spec talks about 
how namespaces apply to attributes (I couldn't find any other place), 
I'd say it's a pretty poorly written.

>> Hm, well, I guess you know what you're talking about :). To me they 
>> seemed to be discussing things which were evident (that is: obviously 
>> <span class="x" xhtml:class="x2"> is illegal because it has 2 
>> attributes with the same name in the same namespace).
> Which clearly is not the case. You're only failing to understand 
> namespaces because you're making them more complicated than they are. 
> Namespaces are entirely, thoroughly, simple and stupid. They have no 
> behaviour whatsoever. They don't inherit. They don't mean anything. They 
> don't magically appear where they haven't been requested.

Hm, well, I think it makes a lot of sense how I described it, and that 
letting them have a null namespace makes exactly those confusing things 
like the class="x" xhtml:class="x" possible.

I really don't think this is complex, it's pretty obvious.


Ushiko-san! Kimi wa doushite, Ushiko-san!!
Received on Wednesday, 15 December 2004 14:08:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:16 UTC