Odd validator behaviour

The following is a minimal HTML code snippet which exhibits odd
behviour in the W3 Validator. (The snippet is also available
at http://www.dcs.ed.ac.uk/home/sxw/broken.html ) 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>Broken page test</TITLE>
</HEAD>
<BODY>
<H2>Test <IMG SRC="test" ALT="test"</H2>
</BODY>
</HTML>

The important line is the one beginning <H2>.

I believe this snippet to be incorrect - the <IMG tag
never ends, and the </H2> gets gobbled - Netscape at least handles
it like that.

However, given Netscape's ropy HTML parsing, and my limited knowledge
of SGML - I'd believe that nsgmls gets it right - and that this is
correct. But could someone explain to me why?

Cheers,

Simon.

Received on Sunday, 25 April 1999 23:56:13 UTC