Re: [xml-dev] MicroXML

From
James Clark <>
To
" List" <>
Date
2010-12-15T09:32:41Z
ID
<AANLkTikjDGJZqCno7Zzx4W6XNgBG=>
Thread
Re: [xml-dev] MicroXML
On Tue, Dec 14, 2010 at 10:27 AM, James Clark <[email protected]> wrote:
  We have two distinct cases:

(a) Allowing something like <br></br>

(b) Allowing something like <a/>

For (a), wouldn't existing parsers simply ignore the end-tag?

It turns out that they do not.  HTML5 says that the error recovery for

<br></br>

is to treat it as

<br><br>

(I find this bizarre in the extreme.) The spec is hard to read but you can see it in

http://dev.w3.org/html5/spec/tokenization.html#parsing-main-inbody

An end tag whose tag name is "br"
Parse error. Act as if a start tag token with the tag name "br" had been seen. Ignore the end tag token.

There is a handy tool for seeing how the HTML5 spec recovers from errors:

http://software.hixie.ch/utilities/js/live-dom-viewer/

James