Re: Incorrect(?) HTML that passes validation

On Sun, 13 Aug 2000, Kristof Burek (from the Cally Road) wrote:

> I have a page ( http://www.yxf87.dial.pipex.com/_content001/BadHTML/AlmostOK.htm )
> which passes the W3C HTML validation Service, but actually has a small
> glitch that I shouldn't think would be regarded as correct.

It is not correct in the meaning 'recommendable', but it is valid
in HTML terms, and such validity is what a validator checks.

> in the <HEAD> element of the page there is a  tag with a missing > sign.  It
> validates OK, but IE5 behaved strangely when I used the "Add to Favorites"
> command which made me comb the page for the glitch that I eventually found.

Actually the comment in your demo is misleading: the tag without a
trailing ">" is a LINK tag, not META tag:

<LINK rel="stylesheet"
type="text/css"
href="/css1/kristof001.css"

<TITLE>...

The reason why this is valid is that formally HTML has been defined as an
SGML application with the SHORTTAG YES feature, which allows various
shorthand notations like omitting ">" when immediately followed by
another tag. (Tech. ref.: SGML Handbook, 7.4.1.2 Unclosed Start-tag).

The handwaving at
http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.7
("Shorthand markup", in an annex to HTML 4 spec)
is to be read as saying: there are lots of abbreviated notations
like [some examples] which are formally valid but will confuse
all major browsers thoroughly.

It's too bad that browsers don't really support HTML, even HTML 2.0,
even in basic issues like parsing. The construction of restricted
versions of HTML, under the XHTML misnomer, reflects this: XHTML
drops out the tag minimization features.

-- 
Yucca, http://www.hut.fi/u/jkorpela/ or http://yucca.hut.fi/yucca.html

Received on Monday, 14 August 2000 06:45:33 UTC