Re: doctype placement

From: Russell Steven Shawn O'Connor (
Date: Mon, Jul 26 1999

Date: Mon, 26 Jul 1999 19:19:37 -0400 (EDT)
From: "Russell Steven Shawn O'Connor" <>
Message-ID: <>
Subject: Re: doctype placement 

The validator can in general handle comments before the the doctype.  Try
this out yourself.  It works fine.

What the validator can't handle is the existance of the string matching
the regex /<[a-z]/i. before the doctype

So in the example given of

the problem lies in line
<!--X-From: Charles Metz <> -->
                         ^^ Here
This is obviously a known issue with the validator, because from the
source code

        last if ( $line =~ /<[a-z]/i );         # found an element
            # @@ this needs to be fixed to handle commented-out markup
            # which appears before the doctype

I was working on setting up nsgmls to automatically assume HTML 4.0 by
adding the line


to my catalog.  I can't remember how sucessful I was at this.  Assuming it
did work, with careful use of multiple catalog files at the commandline, I
think you can get nsgmls to complain about the missing DOCTYPE and
inserting it itself according to whatever heristic you want to use to
choose the DOCTYPE. 

If I have time and I remember, I'll try to look into this tomorrow.

Russell O'Connor                 
``And truth irreversibly destroys the meaning of its own message''
-- Anindita Dutta, ``The Paradox of Truth, the Truth of Entropy''