Re: Minimized tags error

From: Masayasu Ishikawa (mimasa@w3.org)
Date: Tue, Mar 27 2001

  • Next message: Christian Smith: "Re: Minimized tags error"

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