W3C home > Mailing lists > Public > www-international@w3.org > July to September 2011

Re: For review: 1 new and 3 updated articles about language declarations in HTML

From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Date: Mon, 22 Aug 2011 03:52:44 +0200
To: Richard Ishida <ishida@w3.org>
Cc: www International <www-international@w3.org>
Message-ID: <20110822035244476333.3d4546a6@xn--mlform-iua.no>
Richard Ishida, Thu, 18 Aug 2011 16:47:20 +0100:
> Comments are being sought

The first 3 drafts share a common error:

> 1    Working with language in HTML (tutorial format)
> http://www.w3.org/International/tutorials/new-language-decl/Overview.en.php/

> 2    Why use the language attribute?
>     http://www.w3.org/International/tutorials/new-language-decl/qa-lang-why

> 3    Declaring language in HTML

The error is that they all point to 'Styling using language 
attributes', [1] which in turn contains blatant misinformation 
regarding how 'xml:lang="foo"' works: [2]

Using :lang Use of :lang is straightforward. If the document is parsed 
as HTML, the :lang selector will look for a lang attribute value. 
However, if the document is parsed as XML, the :lang selector will look 
for an xml:lang attribute value and ignore any lang attribute value.

And the document then goes on to claim that you *must* declare the xml: 
namespace and also that you *must* use a complicated selector to target 
the the xml:lagn attribute:

@namespace xml "http://www.w3.org/XML/1998/namespace" 
*[xml|lang |= 'ar'] { ... }

or alternatively:

*[xml\:lang = '..'] { ... } 

It is very pity, to put it rather mild, that the an official guide from 
the W3 comes with such wild claims. This is the truth:

 Firstly: there is no such thin as an xml:lang="" attribute. There is 
only a lang attribute in the xml: namespace. 

Secondly: The selector 	*:lang(en){foo:bar} targets the attribute @lang 
in *any* namespace. Or to be explicit: it targets both <p lang="en"> 
and <p xml:lang="en"> (provided that the latter element occurs in an 
xml document!)

 Thirdly: The :lang selector doesn't look for the lang attribute, 
whether in the XHTML namespace or in the xml: namespace. Instead, the 
lang attribute, in either namespace, sets the language of the 
*element*. Thus the :lang(foo) selector "looks" for *elements* that are 
in language 'foo'. 

While the qa-css-lang article is not what is under review, the errors 
in that article seems - as documented by Gunnar Bittersman [3] - to be 
repeated at least in the 'Why use the language attribute?' article - as 
documented by  

The truth is that it language styling in XML documents is as simple as 
language styling in HTML documents. The only difference is that (at 
least some) XML parsers need the @lang attribute to be in the xml: 
namespace in order to work.

[1] http://www.w3.org/International/questions/qa-css-lang

[2] http://www.w3.org/International/questions/qa-css-lang#xmllang

[3] http://www.w3.org/mid/4E518944.8030303@bittersmann.de

Leif H Silli
Received on Monday, 22 August 2011 01:53:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 21 September 2016 22:37:32 UTC