Re: HTML5 output method

On 22/12/2010 02:07, James Clark wrote:
> On the telcon, we talked about an HTML5 output method for XSLT/XQuery.
>
> I was looking at HTML output method for XSLT 1.0 to see how well it 
> would work with HTML5.
>
> Although it's far from ideal, in practice I think it would work 
> reasonably well.
>
> HTML5 has added a few void elements that XSLT won't know about 
> (command, embed, keygen, source, track, wbr), but I believe HTML5's 
> error handling will ignore the end-tag that XSLT will generate in 
> these cases.
>
>
The serialization spec for XSLT 2.0 attempts to anticipate future HTML 
changes:

"The HTML output method MUST NOT output an end-tag for an empty element 
if the element type has an empty content model. For HTML 4.0, the 
element types that have an empty content model are area, base, basefont, 
br, col, frame, hr, img, input, isindex, link, meta and param. For 
example, an element written as <br/> or <br></br> in an XSLT stylesheet 
MUST be output as <br>."

It doesn't of course anticipate the DOCTYPE change, but a processor that 
chose to implement <xsl:output method="html" version="5"/> could 
certainly make that change and no-one would have valid grounds to 
complain about its conformance.

A bigger problem is whether the serializer should expect SVG and MathML 
elements to be in a namespace or not.

Michael Kay
Saxonica

Received on Wednesday, 22 December 2010 09:59:39 UTC