Re: HTML5 and XML syntax

Disclaimer: This is not an official WG response and does not cite a WG  
decision.

On Jan 28, 2008, at 14:31, temp17@staldal.nu wrote:

> Lachlan Hunt skrev:

>> Just process XHTML documents with XML tools and serialise as HTML  
>> before publishing,
>
> Perhaps you want to use XML tools at the client side as well.

If you tool accepts text/html from the Web, others may send you stuff  
that doesn't parse as XML anyway. If you wist to consume text/html  
content and process it with an XML toolchain (XSLT transformers, RELAX  
NG validators, DOM manipulations, etc.) it is much better to replace  
the XML parser with an HTML5 parser that exposes an XML parser- 
compatible API.

Such parsers already exist for Java, Python and Ruby at least. It is  
reasonable to expect that as HTML5 matures, implementations for other  
languages become available. The Java implementation even comes with a  
sample program that allows you to run XSLT transforms on HTML5 as if  
you were running them on XHTML5.

Please see
http://wiki.whatwg.org/wiki/Implementations

> Another advantage with XML syntax is the possibility to use "XML  
> islands", i.e. to embed stuff like MathML and SVG into HTML.

That advantage only works with the application/xhtml+xml content type,  
however, so it isn't a reason why one should pretend to use XML in  
text/html.

>> or just use the HTML-compatible subset of the XML syntax.
>
> That would work, but why doesn't the HTML5 WD recommend that?

Browsers won't parse text/html as XML, so taking the trouble to jump  
through additional hoops would be a waste of authoring effort.

Adhering to the XML syntax in text/html is like marveling the  
emperor's new clothes, basically. (With the exception of very few  
people who do their own stunts.)

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Monday, 28 January 2008 16:42:31 UTC