DTDs

This week’s lesson in my online XML course was on Document Type Definitions (DTDs). They are required for well formed XML documents. The DTD is an XML file itself. It is the grammar of your XML document. The DTD provides structure and meaning to the XML document.

The DTD describes your language. Validation is the process of comparing your XML document to the DTD. If you follow the rules in the DTD, your document is known as being valid.

A good way for developing a DTD is to first write your XML document. Then you can spot the patterns and structure required. You can then go back and write a DTD for future XML documents of the same kind.

The DTD is made up of elements, entities, attributes, and notations. This week we went a little further into what constitutes an element. There are actually three types of elements: simple, compound, and stand alone. Perhaps I shall go into more detail about these types in a future post.