Talk:Document type declaration

This is an old revision of this page, as edited by Mjb (talk | contribs) at 20:39, 30 October 2005 (questioning removal of some content). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Latest comment: 19 years ago by Mjb in topic Doctype semantics

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?
  • 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