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 - Entity syntax

Entities are variables used to define shortcuts that reference normal text or special characters.

An entity reference is a reference to an entity.

Entities can be declared internally or externally.

DTD - Entity example

DTD 实例:
<!ENTITY writer "Donald Duck.">
<!ENTITY copyright "Copyright runoob.com">
XML 实例:
<author>&writer;©right;</author>