[whatwg] several messages about XML syntax and HTML5

Mihai Sucan mihai.sucan at gmail.com
Mon Dec 4 12:01:36 PST 2006


Le Mon, 04 Dec 2006 21:12:46 +0200, Michel Fortin  
<michel.fortin at michelf.com> a écrit:

> Le 4 déc. 2006 à 12:30, Mihai Sucan a écrit :
>
>> <html lang="fr" xmlns="http://www.w3.org/1999/xhtml">
>> <head>
>> <title>Sans titre</title>
>> </head>
>> <body>
>> <p>Bonjour à tous!</p>
>> <p lang="ro">Bună ziua tuturor!</p>
>> <p><img src="merci.png" alt="Merci!" id="mon-image" /></p>
>> </body>
>> </html>
>
> Nice example Mihai.

Merci beaucoup, Michel. :)

> To reformulate my previous suggestion more clearly, this example  
> validates for XHTML 1.0 Strict, but it doesn't for XHTML 1.1 with errors  
> on the two lang attributes. (Using W3C's validator.) It happen to be  
> valid HTML5 according to the current spec too (if you add the proper  
> doctype).

Doh, I wanted to add the <!DOCTYPE html>. I just forgot - haste makes  
waste, eh.

> The question is: should this be valid XHTML5?
> I think it should.

Yes, me too. I actually want this to be valid. Has this proposal been made  
on a stand alone thread? It might get lost.

   - - -

> The HTML5 spec currently gives the following authoring requirements  
> regarding lang and xml:lang:
>
>> The lang attribute only applies to HTML documents. Authors must not use  
>> the lang attribute in XML documents. Authors must instead use the  
>> xml:lang attribute, defined in XML. [XML]
>
> I'd change it for this:
>
> "Only the lang attribute applies to HTML documents. For XHTML documents,  
> authors should instead use the xml:lang attribute as defined in XML,  
> although the lang attribute is also allowed for backward compatibility  
> reasons. If an element has both the lang and the xml:lang attributes  
> set, both attributes must have the same value."
>
> I'm wondering if the two attributes shouldn't be mutually exclusive  
> however, meaning that if one is present, the other must not be.

I'd say... not to allow both attributes in XHTML5, at once. The author  
must pick one of them.

Allowing both on the same tag opens up ambiguities.

Also, I'd specifically make it a warning when mixing in the same document  
the usage of xml:lang on some tags, and lang on others.


-- 
http://www.robodesign.ro
ROBO Design - We bring you the future



More information about the whatwg mailing list