Document Type Definition (DTD) is a grammar (language) that defines the schema (ie data structure) of an XML document.
It
The syntax is a set of markup declarations that define a document type for SGML-family markup languages (SGML, XML, HTML).
DTDs were a precursor to XML schemas and have a similar function, although different capabilities.
A DTD can be declared:
The document type declaration can point to an external subset (a special kind of external entity) containing:
The DTD for a document consists of both subsets taken together.
DTD are context-free grammars