[whatwg] [WA1] lang and xml:lang

Ian Hickson ian at hixie.ch
Sun Apr 17 03:56:55 PDT 2005


On Sun, 17 Apr 2005, Lachlan Hunt wrote:
> 
> # If both the xml:lang attribute and the lang attribute are set, user
> # agents must use the xml:lang attribute, and the lang attribute must be
> # ignored for the purposes of determining the element's language.
> 
> Is that the case for both HTML and XHTML documents?

Yes.


> It would make more sense if, in the case of both being set, lang was 
> used for text/html documents and xml:lang for XML documents.

The only way you can set xml:lang in an HTML document is via the DOM (in 
HTML, there are no namespaces). I don't think it's worth having special 
requirements for something that no-one is likely to ever do outside of 
obscure test cases.


> However, in the case of only one being set but for the wrong MIME type 
> (eg. xml:lang set for text/html document or lang for XML document), for 
> error recovery, should UAs be allowed to fallback on it?

If xml:lang="" is set onin a text/html document, it'll be {html, 
'xml:lang'}, not {xml, 'lang'} which is what xml:lang really is.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list