W3C home > Mailing lists > Public > www-validator@w3.org > October 2002

Re: Beta: Fatal Error: No DOCTYPE specified!

From: Terje Bless <link@pobox.com>
Date: Fri, 25 Oct 2002 17:23:59 +0200
To: W3C Validator <www-validator@w3.org>
Message-ID: <a01060005-1021-C958DBC7E82D11D6AC5400039300CF5C@[]>

Bertilo Wennergren <bertilow@gmx.net> wrote:

>Terje Bless <link@pobox.com>:
>>Bjoern Hoehrmann <derhoermi@gmx.net> wrote:
>>>4) The phrase talks about a "first line", while the document type
>>>declaration in the example takes two lines
>>Yeah, thanks, good catch! I'll fix it ASAP. How does "At the very
>>beginning of your document" sound to you?
>Well, maybe I missed some important context here, but the DOCTYPE
>declaration does not and should not appear at the first line, nor at the
>very beginning of an XHTML document that includes an XML declaration.

Ok, how would you suggest I put it then? I don't particularly care how it's
phrased so long as it's clear and can be understood by the people most
likely to omit a DOCTYPE. A long sentence with three conditionals (iff XML
Decl, and not BOM, then foo) ain't exactly friendly. :-)

Really! If anyone has suggestions for how that should be phrased, please
(please!) do send me a "patch" for it. Here is the original snipped
straight from the current code in CVS:

# Print HTML explaining why/how to use a DOCTYPE Declaration.
sub doctype_spiel {
  return <<".EOF.";
      You should place a DOCTYPE declaration as the very first thing
      in your HTML document. For example, for a typical <a
      href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> document:
      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;

          &lt;!-- ... body of document ... --&gt;
      For XML documents, you may also wish to include an "XML Declaration"
      even before the DOCTYPE Declaration, but this is not well supported
      in older browsers. More information about this can be found in the
      <a href="http://www.w3.org/TR/xhtml1/">XHTML 1.0</a> Recommendation.

Note that this is updated after Björn's comments earlier.

>>XHTML 1.0 also reccomends against including [an XML Declaration] in
>>"Appendix C" documents.
>Does it?
>  XHTML document authors are strongly encouraged to use XML declarations
>  in all their documents (http://www.w3.org/TR/xhtml1/)
>In Appendix C we find this:
>  For compatibility with these types of legacy browsers, you may want to
>  avoid using processing instructions and XML declarations.
>"May want to avoid" is not a recommendation against including,
>especially in the light of the first quotation.

Do I need to tell you that I'm not overly fond of Appendix C of the XHTML
1.0 Recommendation? :-)

Still, it's there and the fact of the matter is that there are browsers out
there that choke on it. I don't particulaly care either way, so if you talk
fast enough I may be convinced. OTOH, what Jim wrote in another message in
this thread also counts rather heavily. So "Let's you and him fight!". :-)

Seriously though, the reason the XML Decl isn't there is probably the same
as what prompted that statement in Appendix C. At the moment I feel the
need to avoid tripping up these "legacy browsers" outweighs the need to
"look to the future", but I'm perfectly willing to be convinced otherwise.

"I don't want to learn to manage my anger;
 I want to FRANCHISE it!" -- Kevin Martin
Received on Friday, 25 October 2002 11:24:02 UTC

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