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

Re: DTD problem, or validator problem?

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 16 Aug 2001 23:17:39 +0200
To: Matthew Wickline <wickline_m@pcfnotes1.wustl.edu>
Cc: www-validator@w3.org, Tim Bagot <tsb-w3-validator-0005@earth.li>
Message-ID: <qicontsvuicrl6u4bdpruhq9d5tb775m4p@4ax.com>
* Matthew Wickline wrote:
>This still leaves me curious about why the validator is not giving any
>errors. Take the following document:
>
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>    "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
><html>
>    <head><title>test</title></head><body><br /><hr /></body>
></html>
>
>
>As I understand it, the first slash (in the BR) says "I'm putting the
>following inside a BR container" and then we put a greaterthan sign in
>the BR container followed by an HR... but the second slash (in the HR)
>says "I'm putting the following in the HR container" and we put a
>greater than sign in the HR container. Then we close the body and the
>HTML, never closing the HR and the BR.

Take this example:

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  <title>test</title>
  <p>...

The <p> closes the implicite head and opens the implicite body since p
doesn't appear in the content model definition of the head element. Same
goes for hr and br, they cannot contain PCDATA so they are closed and
both '>' appear as PCDATA content of the body element in your example.
The document could have been written as

  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
  <html>
      <head><title>test</title></head><body><br>&gt;<hr>&gt;</body>
  </html>

That's just how SGML works...

regards,
-- 
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Thursday, 16 August 2001 17:18:49 GMT

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