RE: question on issue-110 (xml:lang vs. lang)

Thanks Leroy,

But now we have an XHTML document in our HTML5 test suite.
I don’t think that is correct.

Jirka pointed to the HTML5 part of the specification that deals with xml:lang:
http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-lang-and-xml:lang-attributes

It says: “Authors must not use the lang attribute in the XML namespace on HTML elements in HTML documents."

And also: "To ease migration to and from XHTML, authors may specify an attribute in no namespace with no prefix and with the literal localname "xml:lang" on HTML elements in HTML documents, but such attributes must only be specified if a lang attribute in no namespace is also specified, and both attributes must have the same value when compared in an ASCII case-insensitive manner."

So my conclusion is:

a) we can use "xml:lang" in an HTML5 document, but that's not the XML's xml:lang, and it must be there only when lang is also there.

b) if both the 'xml:lang' and lang attributes are present the document is not valid if the values are not the same (in an ASCII case-insensitive manner)

--> Therefore we cannot have valid HTML5 document with lang and xml:lang with different values,
--> therefore we can just read the lang attribute to get the right value
--> therefore we should not have any precedence expectation, nor test for it.

-yves

Received on Wednesday, 30 January 2013 15:39:08 UTC