Version 4 of DTD

Updated 2007-02-23 14:27:42

Document Type Definition

Adjunct to XML and SGML. Defines how tags can be nested, follow each other, etc. Essentially describes the contents of each valid tags as a regular expression. Beyond that it defines the attributes per tag, and their type.

Simple example:

 <!ELEMENT database (record+) >
 <!ELEMENT record (firstname,lastname,phone+)>
 <!ATTLIST record
   created NMTOKEN #IMPLIED
 >
 <!ELEMENT firstname (PCDATA)>
 <!ELEMENT lastname  (PCDATA)>
 <!ELEMENT phone     (PCDATA)>

tDom with its extension tnc can validate XML documents by a given DTD.

As the language of DTDs differs from XML, it is considered old-fashioned, and several replacements (which follow XML syntax) have been proposed: XML Schema, ...


MAKR: There is fun project called A little XML Schema validator ...


[ Category Acronym ]