W3C home > Mailing lists > Public > www-validator@w3.org > March 2001

Re: Minimized tags error

From: Masayasu Ishikawa <mimasa@w3.org>
Date: Wed, 28 Mar 2001 08:33:58 +0900
To: csmith@barebones.com
Cc: www-validator@w3.org
Message-Id: <20010328083358B.mimasa@w3.mag.keio.ac.jp>
Christian Smith <csmith@barebones.com> wrote:

> Why is the validator passing this as valid?

Because this is not invalid.

> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html>
>     <head>
>         <title>Sidebar</title>
>     </head>
>     <body>
>         <p>
>         252 Riddle Pond Road<br />
>         WTopsham VT 05086<br />
>         </p>
>     </body>
> </html>
> 
> This looks like a bug to me. <br /> is an XHTML formatted tag and doesn't
> belong in an HTML document.

The SGML declaration of HTML 4.01 says "SHORTTAG YES", which allows
this kind of shorthand markup.  However, in this case the null end-tag
(NET) delimiter is "/", so ">" is just treated as character data.
In other words, "<br />" is an equivalent of "<br>>" in this case.

Try the validator with "Show parse tree" option, then you'll see
that ">" after "<br /" is not parsed as part of markup but as just
a character in the parse tree.

Regards,
-- 
Masayasu Ishikawa / mimasa@w3.org
W3C - World Wide Web Consortium
Received on Tuesday, 27 March 2001 18:32:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:13:55 GMT