[whatwg] xml:lang and xmlns in HTML

Ian Hickson ian at hixie.ch
Fri Dec 1 15:14:47 PST 2006


On Fri, 1 Dec 2006, Michel Fortin wrote:
> 
> 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.

Right.


> 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).

Correct.


> > > 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.

Ah. I think it is technically possible with the exception of the namespace 
declaration, but I don't know that it is a useful subset.

(I mean, it is technically possible today to create a document that is 
both an HTML4-compliant document and an XHTML1-compliant document at the 
same time, but again, that doesn't seem very useful.)


> > > 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[...]]>.

Ah, yes. To convert an Appendix-C-compliant document to HTML5, one would 
just need to change the DOCTYPE and drop the namespace declaration and one 
would be pretty close (there might be some other esoteric things to 
change, but probably not many). That should be reasonably easy, probably 
just a search-and-replace or a template change.


Cheers,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list