RE: Minimized tags error

Just a comment.  I thought <br>> was treated as <br>&gt; whereas <br />
would be treated as <br "/" > where "/" is the literal string /.  I was
going to say that this could make a difference in processing, but I guess it
doesn't in the cases I could come up with.

Daniel



-----Original Message-----
From: www-validator-request@w3.org
[mailto:www-validator-request@w3.org]On Behalf Of Masayasu Ishikawa
Sent: Tuesday, March 27, 2001 3:34 PM
To: csmith@barebones.com
Cc: www-validator@w3.org
Subject: Re: Minimized tags error


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 Wednesday, 4 April 2001 13:54:14 UTC