- From: Werner Donné <werner.donne@re.be>
- Date: Tue, 14 Dec 2004 12:37:54 +0100
- To: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
- CC: www-html@w3.org, chris@w3.org, www-style@w3.org
Daniel, I think that the sentence "Note that default name spaces do not apply directly to attributes." means that attributes without an explicit name space binding, which are on an element that is not in the default name space, are not in the default name space. By default attributes are local to their elements. The only thing to worry about is their uniqueness in the scope of their element. A name space is not required for this. So it would be natural to think of attributes having the name space of their element as their default name space, though that is not the case strictly speaking. The XHTML spec says that class attributes must be recognised in the XHTML name space. This doesn't imply that the class attributes have a name space themselves. The class attribute is also not global as in the XML Schema sense. They are in fact locally declared for each element. Werner. Daniel Glazman wrote: > > Hi there, > > (message cc'ed to www-style because the problem impacts CSS selectors > and Chris Lilley for the TAG) > > I have a serious problem regarding namespaces and XHTML attributes. First, > let's look at the specs: > > 1) according to XHTML 1.0 section 3.1.1 [1], strictly conforming documents > must contain an xmlns declaration for the XHTML namespace > 2) according to Namespaces in XML section 5.2 [2], the default namespace > of a > doc does not apply directly to attributes > 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> > > 4) the DOM 2 Core spec [4] states again that if an attribute is not > explicitly > given a namespace, it simply has no namespace. > > So, the following is valid XML too, right ? > > <?xml version="1.0"?> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" > xmlns:html="http://www.w3.org/1999/xhtml"> > <head> > <title>Junk title</title> > <style type="text/css"> > .foo { color : green } > .bar { color : blue } > </style> > </head> > <body> > <p dir="rtl" html:dir="ltr" > class="foo" html:class="bar" > this is a paragraph > </p> > </body> > </html> > > a) can someone tell me what is the direction of the paragraph above ? > 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 ? > 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 ? > 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 ? > > As I see it, XHTML is clearly violating the specs, since the whole model > is based on the fact all attributes with no namespace carried by XHTML 1.0 > elements *are* in the XHTML namespace. While the RDF validator requires > from RDF instances that RDF attributes are given the RDF namespace. > > It seems to me that the "an attribute with no namespace declared has no > namespace" model is incompatible with XHTML where "an attribute with no > namespace declared has the namespace of the element node carrying that > attribute" is apparently the rule... Can someone clarify this for me > please ? > > [1] http://www.w3.org/TR/xhtml1/#strict > [2] http://www.w3.org/TR/REC-xml-names/#defaulting > [3] http://www.w3.org/TR/REC-xml-names/#uniqAttrs > [4] > http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-NodeNSname > > [5] http://www.w3.org/TR/xhtml1/#C_13 > > </Daniel> > > -- Werner Donné -- Re BVBA Engelbeekstraat 8 B-3300 Tienen tel: (+32) 486 425803 e-mail: werner.donne@re.be
Received on Tuesday, 14 December 2004 11:38:37 UTC