Talk:Document type declaration

This is an old revision of this page, as edited by 69.87.199.253 (talk) at 00:15, 18 January 2007 (doctype 4.0 transitional). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Latest comment: 18 years ago by 69.87.199.253 in topic doctype 4.0 transitional

Doctype semantics

Anonymous edits from 217.140.228.85 removed these claims (which were mine), saying they were misunderstandings:

  • The DOCTYPE declares the document as being of 'type' "html" (or whatever the root element is declared to be).
    • This was removed altogether, and made to say that the DOCTYPE just includes a DTD by reference. I concede that the original phrasing wasn't the way I really intended to express things, but I did mean to say more than just that there's a reference to a DTD. I meant to say that the DOCTYPE declares the document as being of a particular 'type' as defined by two pieces of information: a particular DTD, and a clarification of which element type declared in the DTD must be used as the root element, since DTDs are sometimes ambiguous in this regard. Would you disagree with that?
      • I would not disagree with the two pieces of information but I do disagree with them being characterized as the "type" of the document. People tend to understand as the "type" of the document having values like HTML, DocBook, TEI, etc. -- The maker of the anon edits
  • The root element, if given in the DOCTYPE, must match the document's actual root element.
    • This got changed to just say that the root element is declared to be "html" (in the example). With the original phrasing, I wanted to imply that the root element did not necessarily need to be given (in XML, at least, it is optional, although I believe it was an oversight in the grammar) and also that there is a validation requirement associated with it: in XML, at least, if the root element is named in the DOCTYPE, then the name of the document's actual root element must match. Is this irrelevant?
  • The SYSTEM identifier is used when the DTD cannot be obtained via the PUBLIC identifier.
    • This was changed to say that a processor may use either ID, as it chooses, to know what DTD to use. I think you're correct; I had assumed, based on a particular catalog implementation, that public IDs were preferred when both were available.

mjb 20:39, 30 October 2005 (UTC)Reply

doctype 4.0 transitional

Netscape Composer 4.77 insists on generating HTML that starts:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

but 4.0 is not listed as among current doctypes. And these statements are supposedly case sensitive, and the proper form of this statement is apparently:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">

but whether correcting case that way does any good is not clear, since the current validators may not recognize 4.0 as valid in any event. Which all leaves open the question of how various real-world browsers treat such HTML webpages. What is the optimum way to hand patch the doctype in code generated by 4.77? Tidy seems to want to change it to XHTML 1.0:

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

It's all pretty weird, considering that many millions of webpages must have been generated by 4.77, and many must still be floating around in cyberspace. 69.87.199.253 00:15, 18 January 2007 (UTC)Reply