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"> -->

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 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:17:28 UTC