I18N-ISSUE-138: Make lang and xml:lang synonyms in HTML5 [HTML5-prep]

I18N-ISSUE-138: Make lang and xml:lang synonyms in HTML5 [HTML5-prep]


Raised by: Richard Ishida
On product: HTML5-prep

I imagine this will get shot down, but I've been thinking I should suggest it for some time.

It's a pain in the neck to have to write both lang and xml:lang attributes on an element in a polyglot document, and I've seen plenty of pages in the wild from people who should know better where either the lang attribute is missing in XHTML 1.x but the xml:lang attribute is there, as well as vice versa.

Can we not just make xml:lang a synonym of the lang attribute?  

I think the spec would need to describe what to do if both are used, to deal with legacy, but only small changes would be required to the wording to say that if an attribute in no namespace with no prefix and with the literal localname "xml:lang" appears alone, then its should be treated as equivalent to a lang attribute, and that of course you should use the lang attribute unless this is a polyglot or XML document.

Received on Wednesday, 27 July 2011 14:29:04 UTC