Back to Terminology

Document Type Definition (DTD)

January 29, 2023

A Document Type Definition (DTD) is a set of rules and guidelines that define the structure and syntax of an XML or HTML document. It is used to specify the elements, attributes, and relationships that can be used in a particular document. A DTD is often used to validate an XML or HTML document, ensuring that it conforms to the predefined structure and syntax.

A Document Type Definition (DTD) can be defined in two ways:

Internal DTD: This is a DTD included within an XML or HTML document. The DTD is defined using a special DOCTYPE declaration at the beginning of the document.

External DTD: This is a DTD stored in a separate file and referenced by an XML or HTML document using the SYSTEM or PUBLIC keyword in the DOCTYPE declaration.

DTDs are not as popular as they used to be due to the introduction of the XML schema and RelaxNG, which provides more powerful and flexible validation options.

DTDs are still used in some cases, especially in legacy systems, and it’s good to know that it exists and their purpose.

Also, See: Document Object Model (DOM)

Guaranteed Customer Satisfaction

We Promise. We Innovate.

Do you have an idea? Our experts are there to transform it into a recognized brand. We help you innovate your business with best-in-class solutions.
  • We will respond to you within 24 hours.
  • We’ll sign an NDA if requested.
  • You'll be talking to product and tech experts (no account managers).