Re: Polyglot Markup/XML encoding declaration

(chair hat off)

On Aug 1, 2010, at 12:55 AM, Leif Halvard Silli wrote:

> Lachlan Hunt, Thu, 29 Jul 2010 15:30:02 +0200:
>> 
>> A polyglot may be served as HTML too.  HTML5 does consider the XML 
>> declaration to be non-conformant, and including it is unnecessary 
>> polution.
> 
> This touches the question of whether Polyglot Markup is a specification 
> or a authoring guide. The TAG by Tim Berners Lee has suggested that is 
> to be a specification. Of course, even as a spec, it does not need to 
> include the xml declaration. But if it is a spec, then it could include 
> it.

[...]

>>> The XML declaration would not be generally permitted in HTML - it would
>>> only be permitted in polyglot markup.
>> 
>> There is no way to make some syntax conforming for polyglot documents 
>> only.
> 
> Just make a validator which does.

The original premise of the polyglot spec was to describe a type of document that is valid as both HTML5 and XHTML5, and works sufficiently the same both ways. Thus, it does not match the original goals to have a construct that is valid in polyglot documents, but invalid in at least one of HTML5 or XHTML5. Indeed, Lachlan already pointed this out:

> 
>> Such a requirement is unenforceable because the conforming 
>> polyglot document syntax is and should remain only the intersection 
>> of HTML and XHTML syntax.


Also, besides this general point, there is the fact that an XML declaration will trigger quirks mode in some legacy UAs, thus it is a bad idea to serve content including an XML declaration as text/html.

Regards,
Maciej

Received on Monday, 2 August 2010 00:05:56 UTC