A DTD is one component inside an
SGML or
XML environment. It defines the syntactic rules according to which a document can be composed. There are no semantics associated with the elements and attributes defined in a DTD, although normally the names chosen for elements and attributes will have some meaning to them. Using a DTD and an
XML Processor, a document can be validated against the DTD, which means it can be tested whether it conforms to a given DTD.
HTML is one example of an
SGML DTD (which has been reformulated as an
XML DTD in
XHTML).