Re: XHTML attributes and namespace, clarification needed

Laurens Holst wrote:
> 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.

As a former philosophy student, I know my logic. One thing it also 
taught me is that if you try to spell out each logical step taken in a 
given argument instead of relying on people's ability to fill in the 
blanks is cumbersome at best. I may have been wrong, but either way I'll 
spare us the trouble of going through it by quoting another part of the 
spec:

"The namespace name for an unprefixed attribute name always has no value."

> However when they inherit their namespace from their element, it makes 
> sense.

Good old classical logic had it right: ex falso sequitur quodlibet :)

> 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.

There's nothing confusing about that. If you expand to clarkian notation 
you get:

   {}class
   {http://www.w3.org/1999/xhtml}class

Again, the only reason people misunderstand namespaces is because they 
keep trying to make them do things that are simply not in the spec. The 
rules to remember about namespaces fit on a card[0]:

   * the binding of a namespace to a given prefix is declared with
     xmlns:prefix='...'
   * an element or attribute using that prefix is then in that namespace
   * the default namespace applies to elements that do not have a prefix.
     It is declared with xmlns='...'
   * the default namespace does not apply to attributes, attributes with
     no prefix are in no namespace
   * the declaration of a namespace is in effect from the tag on which it
     occurs to its corresponding closing tag

That's all there is to know. Print it out, carry it around. It's simple.

[0]http://expway.com/robin/ns-card/ns.fo
    http://expway.com/robin/ns-card/ns.pdf
-- 
Robin Berjon

Received on Wednesday, 15 December 2004 14:52:31 UTC