Document type definitions (DTDs) define legal building blocks for XML documents. It uses a series of legal elements to define the structure of the document.

A DTD can be declared in an XML document as a line or as an external reference.

DTD - attributes syntax

In a DTD, attributes are declared using the ATTLIST declaration.

DTD - attributes example

 DTD 实例:  XML 实例: