[whatwg] HTML5 Parsing spec first draft ready

Simon Pieters zcorpan at hotmail.com
Sat Mar 11 06:17:19 PST 2006


From: Henri Sivonen <hsivonen at iki.fi>
>BTW, the spec also says: "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."
>Shouldn't lang take precedence in HTML?

According to the terminology [1] "xml:lang" means the lang attribute in the 
XML namespace. You can have it in HTML documents with script:

   <!doctype html>
   <html lang=x-fail>
    <title>xml:lang vs lang</title>
     html:lang(x-pass) { background:lime; }
     html:lang(x-fail) { background:red; }
    <p>FAIL (script did not run).
"lang", "x-pass");
     document.body.firstChild.firstChild.data = "This page should have a 
green background.";

Why should the lang attribute (in the null namespace) take precedence in 

[1] http://whatwg.org/specs/web-apps/current-work/#terminology

Simon Pieters

More information about the whatwg mailing list