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

Validator confused by commented-out <DOCTYPE>

From: Rich Pasco <pasco@acm.org>
Date: Sat, 10 Feb 2001 11:43:37 -0500 (EST)
Message-ID: <3A856FA3.18E162B0@acm.org>
To: www-validator@w3.org
The W3C HTML validator gets confused about the document type when
a commented-out DOCTYPE line precedes the real one.

I tried to validate an HTML file beginning with the lines:

<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd"> -->
<!DOCTYPE HTML PUBLIC "ISO/IEC 15445:2000//DTD HTML//EN">

My intention was to validate the document as ISO HTML, and judging
by the error messages (e.g. BGCOLOR disallowed) in fact it was.
However, the validator listing began with the bullet:

  Document type: HTML 4.0 Transitional

which is incorrect.  Apparently, the validator proclaimed the document
type based on the first DOCTYPE tag found (even though it was commented
out), but then correctly validated the document according to the second
DOCTYPE (not commented out).

Please copy me on any reply since I do not subscribe to the list.

     - Rich
Received on Sunday, 11 February 2001 23:16:44 GMT

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