DTD

A DTD (Document Type Definition) is the official means of defining the syntax of a variety of SGML, XML, or related-format document, though more recently XML formats are being defined using XML Schema Definitions instead because this latter format is cognizant of multiple namespaces.

As HTML was originally an application of SGML, DTDs were used. XHTML is an XML version of HTML and also uses DTDs, but HTML 5 is no longer defined based on such document types and instead has a more "pragmatic" spec based on defining the expected behavior of a properly implemented parser.

Documents using a DTD have a DOCTYPE declaration at their head (beneath an optional XML declaration in the case of XML), and sometimes these declarations include a URL which might resolve to an appropriate DTD file (but there need not be one directly referenced this way; document types can also be determined by matching a known public identifier).

Sample files

 * HTML 4.01 strict DTD
 * HTML 4.01 transitional DTD
 * XML Schema DTD

Utilities

 * DTD and Schema Validator

Links

 * Wikipedia article
 * DTD tutorial