[whatwg] xml:lang and xmlns in HTML

Michel Fortin michel.fortin at michelf.com
Fri Dec 1 15:09:23 PST 2006


Le 1 déc. 2006 à 11:07, Ian Hickson a écrit :

> On Fri, 1 Dec 2006, Michel Fortin wrote:
>>
>> I wonder if xml:lang and xmlns couldn't be made legal in HTML.  
>> xml:lang
>> would simply become conformant in HTML as a synonym for the lang
>> attribute, it's already in the spec that it should get the correct
>> treatment anyway.
>
> Except that wouldn't be backwards compatible since xml:lang="" isn't
> treated as a language attribute in legacy UAs.

Yes I see. At the time I thought the spec required xml:lang to work  
in HTML, because of the way xml:lang is mentioned in the section  
about the lang attribute. Now I see it's the "lang" attribute in the  
"xml" namespace that would work, not the "xml:lang" attribute HTML  
would have.

But I think the reverse could work: xml:lang cannot work in HTML, but  
lang (html:lang) do work in XHTML if I'm not mistaken (although it's  
non-conforming).


>> This would make it possible to have documents conformant with both
>> syntaxes at the same time.
>
> I thought XHTML-sent-as-text/html had explained in painful detail why
> that's not a desirable end goal. Why would we want this?

I don't want to send XHTML as text/html. I want to see if it's  
possible to have a common subset between HTML and XHTML at the markup  
level, so that someone can create a document that is conforming both  
with XHTML to HTML.

I'm not sure if this is desirable or not, that's why I was asking for  
opinions. I see that it may also be completely irrelevant, but I  
don't really know what to think.


>> This could also help reinforce the idea that it's the media type that
>> differentiate HTML from XHTML. It'd make many valid XHTML1  
>> documents out
>> there conformant with HTML5 with a mere modification to the doctype.
>
> Not if they use things like <![CDATA[...]]> or the empty element  
> syntax on
> non-void elements, or any number of other XMLisms.

Well, by "out there" I meant all the XHTML1 documents that are built  
for text/html, that validates and which don't use any feature that  
both parser can handle. This certainly does not include <![CDATA[...]]>.

Sorry if I wasn't clear; "out there" was certainly misnomer.


>> What do you think?
>
> I don't think it's a goal for the two serialisations to have a common
> subset.

That's fine with me.


Michel Fortin
michel.fortin at michelf.com
http://www.michelf.com/





More information about the whatwg mailing list