W3C home > Mailing lists > Public > public-html-comments@w3.org > January 2008

Re: HTML5 and XML syntax

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Mon, 28 Jan 2008 11:25:13 +0100
Message-ID: <479DAD89.1070502@lachy.id.au>
To: temp17@staldal.nu
CC: public-html-comments@w3.org

temp17@staldal.nu wrote:
> Simon Pieters skrev:
>>> Why is it forbidden to use the XML syntax with text/html?
>> It's not forbidden. 
> I got that impression when reading this paragraph in the WD (section 1.3):
> -----
> XHTML documents (XML documents using elements from the HTML namespace) 
> that use the new features described in this specification and that are 
> served over the wire (e.g. by HTTP) must be sent using an XML MIME type 
> such as application/xml or application/xhtml+xml and must not be served 
> as text/html. [RFC3023]
> -----

The XHTML-compatible syntax that is allowed in text/html is only a 
subset of XML syntax, such as the xmlns attribute and and trailing slash 
for void elements.  Using non-HTML-compatible XML syntax in text/html is 

> It would be good if the xml:lang attribute was allowed in HTML documents 
> though:
> -----
> The xml:lang attribute may only be used on elements of XML documents. 
> Authors must not use the xml:lang attribute in HTML documents.
> -----

Why?  It would also serve no purpose.

>>> Why is this syntax [the traditional non-XML syntax] recommended?
>> AIUI, because of wider support in UAs, because the syntax is more 
>> forgiving, and because most authors use it already.
> Wider support in UAs is a valid argument. But I don't understand why 
> more forgiving syntax is an advantage.

Because it means that if a well-formedness error accidentally slips into 
the markup, then end users aren't presented with a Yellow Screen of 
Death, describing an error that they probably won't understand and can 
do nothing about.

> Because it is an advantage to be able to process HTML documents with XML 
> tools. And it's easier to parse.

Just process XHTML documents with XML tools and serialise as HTML before 
publishing, or just use the HTML-compatible subset of the XML syntax.

Lachlan Hunt - Opera Software
Received on Monday, 28 January 2008 10:25:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:24 UTC