Re: "Canonical" HTML5 and XHTML5 output

On Jul 26, 2007, at 3:54 AM, Thomas Broyer wrote:

> 2007/7/26, Cecil Ward:
>>
>> Robert Burns wrote:
>>
>> > Outputting as html should work (am i missing something?).
>>
>> As far as XHTML5 is concerned: IMO you are never at liberty to use
>> the output method=html from XSLT to generate XHTML because XHTML
>> _is XML_
>
> ...and I don't think Robert ever said the contrary. I'm pretty sure he
> was talking about the text/html serialization, which I think is
> compatible with the one described in XSLT's <xsl:output method="html"
> /> (given that HTML5 retains backwards compatibility with HTML4 and
> thus don't introduce new empty elements that would otherwise be
> incorrectly parsed by current UAs)
> http://www.w3.org/TR/xslt#section-HTML-Output-Method

Well, I was actually talking about either since Cecil had originally  
asked about transforming to XHTML5 or HTML5. I don't work with XSLT  
regularly so I may not understand the issue correctly, but if someone  
wants to transform XHTML1 to XHTML5 or to HTML5 I think there's not  
much to transform except output as html for HTML5 and output as XML  
for XHTML5.

There wouldn't really be much in terms of transform involved except  
for the DocType declaration. The only other transforms necessary  
would involve removing any elements or attributes deprecated by HTML5  
(whatever those end up being when we complete our recommendation) and  
substituting HTML5 approved semantics instead. For example, Removing  
all TT elements and replacing those with <span class='teletype'>. Or  
in the case of strict XHTML1, it might be necessary to in the case of  
a table that included superfluous headers attributes to remove those  
attributes and set the appropriate @scope values on the header cells.  
However, these are hypotheticals at this point since we haven't  
completed the HTML5 recommendations. However these hypotheticals  
constitute the types of transformations required to turn XHTML1 into  
either XHTML5 or HTML5 (canonical HTML5 anyway).

These hypothetical removals are only necessary for an XSL transform  
that wants to create document conforming HTML5 (or XHTML5). If the  
goals is to create HTML5 that works in HTML5 conforming UAs, then  
transforming need only change the DocType declaration and select  
either method='html' for HTML5 and method='xml' for XHTML5.

On Cecil's other question (adding a description of canonical output),  
I'm don't know enough about XSLT and typical XSLT practice to answer  
that question.

Take care,
Rob

Received on Thursday, 26 July 2007 20:43:05 UTC