I recently did a course in this..
A DTD (document type definition) specifies the structure of elements for an XML document. By specifying a particular DTD a user of the XML document can ensure that the XML document meets the specification. Here is an example of an XML document...(pardon me not tabbing in the tags)
<?xml version="1.0"?>
<!DOCTYPE products SYSTEM "MyDTD.dtd">
<company>
<contact>
<id>1</id>
<FirstName>Jim</FirstName>
</contact>
</company>
Now here is the MyDTD.dtd file.
<!ELEMENT company (contact)*>
<!ELEMENT contact (id, firstname)>
<!ELEMENT id (#PCDATA)>
<!ELEMENT firstname (#PCDATA)>
The DTD above tells that an element of type "company" must exist and it contains a "contact". The * indicates that zero or more contacts can exist for a company. The second line indicates that each contact element has an id and a firstname element. Without the *, this says that there can be only one id and firstname for each contact element. Finally, the #PCDATA keyword indicates the parsed data itself.
The benefit of a DTD is that it can be shared by multiple businesses that share similar data. This, however, is done mostly nowadays with something called Schemas which is something else entirely.
Hope this helps!
[This message has been edited by kking (edited September 19, 2000).]
[This message has been edited by kking (edited September 19, 2000).]