Document Type Declaration

The Document Type Declaration, also called the DOCTYPE declaration, is optional. If present, it must occur before the document element. The DOCTYPE declaration specifies the element type name of the document element and, optionally, references external markup declarations or may include markup declarations.

The simplest form of the Document Type Declaration may be written as follows:

<!DOCTYPE theDocumentElement > 
<theDocumentElement> 
<!-- The content of the document element would go here --> 
</theDocumentElement> 

As written, the preceding DOCTYPE declaration simply indicates that the document element of the XML document has the element type name of theDocumentElement.

In addition to indicating the element type name ...

Get Sams Teach Yourself XML in 10 Minutes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.