DTD

Stands for "Document Type Definition." A DTD defines the tags and attributes used in an XML or HTML document. Any elements defined in a DTD can be used in these documents, along with the predefined tags and attributes that are part of each markup language. The following is an example of a DTD used for defining an automobile:

<!DOCTYPE automobile [
   <!ENTITY header "Car Details">
   <!ELEMENT make (#PCDATA)>
   <!ELEMENT model (#PCDATA)>
   <!ATTLIST model doors (two | four) #required>
   <!ELEMENT year (#PCDATA)>
   <!ELEMENT engine (#PCDATA)>
   <!ATTLIST engine transmission (manual | automatic) #required>
]>

The above DTD first defines the header of the item as "Car Details." Then it provides elements to define the make and model of the automobile. The "#PCDATA" data type means it can be any text value). The "ATTLIST" tag on the next line provides options for a specific element. In this case, it states that the model can have either two or four doors. The DTD then provides elements for the year and engine type of the car, followed by a choice of either a manual or automatic transmission for the engine.

The above example is a basic DTD that only uses a few data types. Document type definitions used for large XML databases can be thousands of lines long and can include many other data types. Fortunately, DTDs can be easily modified in a text editor whenever changes need to be made.

Updated 2006

Definitions by TechTerms.com

The definition of DTD on this page is an original TechTerms.com definition. If you would like to reference this page or cite this definition, you can use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about the DTD definition or would like to suggest a new technical term, please contact us.

Want to learn more tech terms? Subscribe to the daily or weekly newsletter and get featured terms and quizzes delivered to your inbox.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.