DOCTYPE (was Re: Announcement: SAX 1998-01-12 Draft)

Andrew Greene agreene at
Tue Jan 13 16:36:43 GMT 1998

   Date: Tue, 13 Jan 1998 16:39:28
   From: Peter Murray-Rust <peter at>


   My current reading is:

   <!DOCTYPE FOO PUBLIC "-//FOO-BAR//DTD V1.23//" "foo.dtd">

   The FOO simply means that the root of the document is a single FOO element.
   The only reason things it can be used for are:
        - telling you what is in the document (i.e. you might want to keep on
          reading if the document root was POEM).
        - telling that parser that if the document does NOT have a
          root element of type FOO it can throw a Draconian error and 
          not do any more work.

   IMO I can live without this :-)

You left out another use of the FOO in that declaration, which is
that it identfies which element type in the DTD is "topmost". 

I have a collection of pages which are a catalog of sheet music.
The various pages have different high-level structure but the
low-level "paragraphs" are the same. I can have a single DTD that
describes each of the following:

  * ComposerPage    (contains a biography and a list of compositions)
  * PublisherPage   (contains contact information, shipping costs,
                     and a list (sorted by title) of compositions)
  * NationalityPage (contains a description of national musical history
                     and a list (sorted by composer) of compositions)
And so each of these XML files can start off with the appropriate
document type identifier:

 <!DOCTYPE ComposerPage SYSTEM "musicDB.dtd">
 <!DOCTYPE PublisherPage SYSTEM "musicDB.dtd">
 <!DOCTYPE NationalityPage SYSTEM "musicDB.dtd">

I *can* live without this, but I'd rather not have to! :-)

- Andrew Greene

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list