• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 37. Toward XML > Constructing the XML Document Prolog: The Document Typ...

Constructing the XML Document Prolog: The Document Type Declaration

The prolog of an XML document contains several statements. The first, the XML declaration, declares that the following document is XML. The second, the Document Type Declaration, is the method you use to identify the Document Type Definition (DTD) used by a particular document. The fact that the acronym DTD might apply to the Document Type Declaration is an unfortunate coincidence. DTD refers only to the latter, not the former. There can be only one Document Type Declaration in an XML document, so it's entered on the document instance itself. Because multiple DTDs can be combined to make a single document, this allows control of DTD loading to reside in each individual document.

The Document Type Declaration (DOCTYPE) has two parts, both optional. The first references an external DTD and uses the keywords PUBLIC or SYSTEM to identify a catalog entry or a URI, respectively. If catalogs aren't implemented in your XML processor, you can specify both parts at once without the second keyword:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint