Bug 16190 - Polyglot Markup: Clarify that xml:lang is optional
Summary: Polyglot Markup: Clarify that xml:lang is optional
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML/XHTML Compatibility Authoring Guide (ed: Eliot Graff) (show other bugs)
Version: unspecified
Hardware: PC All
: P3 normal
Target Milestone: ---
Assignee: Eliot Graff
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/html-xhtml-au...
Depends on:
Reported: 2012-03-01 23:12 UTC by Leif Halvard Silli
Modified: 2013-04-08 21:40 UTC (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Leif Halvard Silli 2012-03-01 23:12:01 UTC
Per HTML5, the @lang attribute can be used in both XHTML and HTML:

"The lang attribute in no namespace may be used on any HTML element." <http://www.w3.org/TR/html5/elements#attr-lang>

"The term "HTML elements", when used in this specification, refers to any element in that namespace, and thus refers to both HTML and XHTML elements." <http://www.w3.org/TR/html5/infrastructure#html-elements>

Therefore, Polyglot Markup should specify that xml:lang is optional.

Aslo see: 16166#c2
Comment 1 Leif Halvard Silli 2012-03-01 23:14:23 UTC
(In reply to comment #0)
> Aslo see: 16166#c2

See Bug 16166#c2
Comment 2 I18n Core WG 2012-03-23 17:32:39 UTC
I don't believe this is appropriate. See my rationale in comment 7 at https://www.w3.org/Bugs/Public/show_bug.cgi?id=16166
Comment 3 Leif Halvard Silli 2012-03-25 01:23:55 UTC
(In reply to comment #2)
> I don't believe this is appropriate. See my rationale in comment 7 at
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=16166

I don't think your justification there is good enough.

(1) The point is that if one is to make an application/xhtml+xml document, then one isn't required to use xml:lang, if all one cares about is XML-capable HTML5-parsers.

     And so, the question begs to be asked: Why must I, suddenly, use xml:lang, it the document
     is supposed to be 'polyglot'? 

     I agree that you, in bug 16166, 7th comment, have pointed out some reasons why an author might want the document to contain xml:lang.  But I see no *must* in there - it all depends on how "naked" you expect the XML parser to be.

(2) Meanwhile, in 16166, you suggest that text/html parsers should start to handle xml:lang. So, if that proposal were to be accepted, how would this impact on Polyglot Markup? My presumption is that you would like to be able to produce polyglot markup which contained xml:lang, without any requirement that @lang is present. 

(3) HTML+RDFa 1.1 is agnostic about xml:lang versus lang

(4) RDFa Core likewise says:  "In XHTML+RDFa [XHTML-RDFA], for example, the XML language attribute @xml:lang or the attribute @lang is used to add this information, whether the plain literal is designated by @content, or by the inline text of the element:" 

And so, I maintain that xml:lang should be optional. It would also be good to point out when/for what xml:lang is useful.
Comment 4 Eliot Graff 2013-04-08 20:38:15 UTC
This ended abruptly and without conclusive proposed text. The same seems true for bug 16166, in which much relevant discussion took place. Am I to take it that Leif's final thoughts in comment 3 contain the resolution, that xml:lang should be optional? 

I tend toward keeping the text as it is, that polyglot markup uses both xml:lang and @lang. If you have come to consensus otherwise, however, I am willing to incorporate that.
Comment 5 Leif Halvard Silli 2013-04-08 21:33:37 UTC
(In reply to comment #4)

Hi Eliot,

consider that I have changed my mind: xml:lang should be considered <del>polyglot</del> <ins>robust</ins>. Thus, no change, basically.

The thing is that xml:lang is *not* necessary in XHTML since a conforming XHTML parser will understand the @lang attribute.

However, from a *robust* viewpoint, it can be defended that xml:lang should be in.