Re: Error recovery

On Sat, 2012-11-17 at 13:27 -0700, Uche Ogbuji wrote:

> > (a) <e a="x"/>, or
> >
> > (b) <e a="x/">

> I prefer (a) since it's the likeliest interpretation of the author's
> intention.

<p><a href=/socks/>more interesting articles</a></p>

(a) is not unreasonable; a better implementation would look ahead and
find the </a>, although in HTML one could perhaps omit the </a> because
of the </p> and have the "right thing" happen, because of the
domain-specific knowledge in the parser. (b) is the right answer here of
course.

Since MicroXML is/was aimed at Web usage, I think (b) the better choice,
*or* build-in to the parser a list of empty HTML elements and use (a)
for those and (b) for the rest.

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author, 5th edition of "Beginning XML", Wrox, Summer 2012

Received on Saturday, 17 November 2012 22:06:45 UTC