W3C home > Mailing lists > Public > www-style@w3.org > February 2008

Re: [css3-namespace] what is a "no namespace"

From: Christof Hoeke <csad7@t-online.de>
Date: Tue, 19 Feb 2008 19:57:53 +0100
Message-ID: <47BB26B1.1090106@t-online.de>
To: Anne van Kesteren <annevk@opera.com>
CC: Richard Ishida <ishida@w3.org>, 'fantasai' <fantasai.lists@inkedblade.net>, 'Www-style' <www-style@w3.org>

Anne van Kesteren wrote:
> 
> On Tue, 19 Feb 2008 12:13:09 +0100, Richard Ishida <ishida@w3.org> wrote:
>> I think that clarifies the meaning wrt the syntax, but it's still not 
>> clear to me in what circumstances you would need to use this.
> 
>  <x xmlns="x">
>   <y xmlns=""/>
>  </x>
> 
> To select y you'd use either
> 
>   @namespace foo "";
>   foo|y { ... }
> 
> or
> 
>   |y { ... }
> 

This is more or less the issue which the XML Namespace specification 
would prevent. Defining a namespace with the empty string as 
namespaceURI is not allowed in XML...


>> Also, I found myself wondering whether this means that we have to 
>> change all style sheets for XHTML files, where the html element 
>> defines a default
>> namespace, so that the selectors match xhtml elements.
> 
> No. By default type selectors match elements in every namespace. 

Is that really how it works? If browsers would match elements in "every 
namespace" browsers would not handle namespaces as defined by the spec? 
(or am I too confused this evening?)


I somehow assumed as you write later that Browsers somehow use something 
like

	@namespace "http://www.w3.org/1999/xhtml"

for XHTML files. For HTML not using namespaces they use more or less

	@namespace ""

(in this case the empty string is even allowed in XML but it also hardly 
makes any sense at all as there is only the empty namespace anyway if 
one could call it that here)

> So
> 
>  html { ... }
> 
> works for
> 
>   <html xmlns="x"/>
> 
> or
> 
>   <html xmlns="http://www.w3.org/1999/xhtml"/>
> 
> or (in HTML):
> 
>   <HTMl>
> 
> Note that most browsers, for CSS purposes at least, already act as if 
> HTML elements are in the http://www.w3.org/1999/xhtml namespace.

(this is what I tried to summarize above)

> 
> 
>> I guess I'm looking for information about how this is applied along 
>> with the syntactic description.
> 
> Why? It's pretty self-evident. (If the namespaces concept of XML 
> namespaces is itself not clear, which seems to be the problem here, I 
> suggest simply not bothering with them. Namespaces are hardly relevant 
> on the Web anyway.)

(I guess they are relevant if you have something like ATOM embedded in 
XHTML or are also useful if you like to style a SVG element embedded in 
XHTML (very useful when using Prince-XML). But you are of course right 
that most websites work just without.)


christof
Received on Tuesday, 19 February 2008 18:58:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:01 GMT