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 in 2006 by Per C.

quizTest Your Knowledge

What is designated section of computer memory used for storing data called?

A
Memory card
0%
B
Memory slot
0%
C
Memory bank
0%
D
Memory drive
0%
Correct! Incorrect!     View the Memory Bank definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of DTD on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please 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 this definition or would like to suggest a new technical term, please contact us.

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.