Validator confused by commented-out <DOCTYPE>

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 UTC