XML DTD
A DTD (Document Type Definition) defines the element structure, attributes, and entities of an XML document with <!ELEMENT>, <!ATTLIST>, and <!ENTITY>.
Purpose
To define the structure and legal content model for XML documents, used to validate compliance and define entities.
Mechanism
<!ELEMENT name (content-model)> defines an element and its child sequence/choice/repetition; <!ATTLIST> defines attribute names, types (ID/IDREF/NMTOKEN/enumeration), and defaults; <!ENTITY> defines named text or character entities.
Use cases
- XML document validation
- HTML entity definitions
- SVG structure definitions