Re: XHTML attributes and namespace, clarification needed

Daniel Glazman wrote:
> 3) according to Namespaces in XML section 5.3 [3], the following is ok:
> 
>      <x xmlns:n1="http://www.w3.org"
>         xmlns="http://www.w3.org" >
>        <good a="1"     n1:a="2" />
>      </x>

Yes, since you have two distinct {}a and {http://www.w3.org}a attributes

> So, the following is valid XML too, right ?
> 
>      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
>            xmlns:html="http://www.w3.org/1999/xhtml">
>        <body>
>          <p dir="rtl"   html:dir="ltr"
>             class="foo" html:class="bar"
>            this is a paragraph
>          </p>
>        </body>
>      </html>

Yes it is.

> a) can someone tell me what is the direction of the paragraph above ?

It's 'rtl'.

> b) XHTML 1.0 spec section C.13" [5] says "Within the XHTML namespace, user
>    agents are expected to recognize the "class" attribute". But in
>    <p class="foo">, [2] states that the class attribute has NO namespace...
>    So can someone tell me what is the class of the paragraph above ?

It's 'foo'. What I believe we have here is a poor choice of words rather 
than a mistake. The sentence you quote above should read: "Within 
*elements in* the XHTML namespace, user agents are expected to recognize 
the 'class' attribute", or something along those lines.

Something similar already came up a while back (sorry, member only):

   http://lists.w3.org/Archives/Member/w3c-html-wg/2004JulSep/0111.html

> c) if the answer is "it has two classes, one with no namespace and the
>    other in the XHTML namespace", can someone explain me which one is
>    used for the class selector in CSS ? And what is the text colour of the
>    paragraph ? And which attribute editing tools should offer to handle ?

Having two classes would be just wrong.

> d) shouldn't **all** XHTML attributes declare the XHTML namespace ? I
>    understand this would be a mess but isn't it what the specs quoted
>    above seem to imply ?

No, that would be terrible. They should simply never be in a namespace. 
XHTML M12N has some provisions for XHTML attributes to become available 
to other vocabularies, but it's not automatic.

-- 
Robin Berjon

Received on Tuesday, 14 December 2004 22:37:07 UTC