[whatwg] several messages about XML syntax and HTML5

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.

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). The question is: should this be valid XHTML5?

I think it should.

  - - -

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.


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

Received on Monday, 4 December 2006 11:12:46 UTC