Respecting Authority
By Michael Floyd
A cornerstone of XML development is the document type definition. DTDs let you model your data, define its organization and structure, and place constraints on its usage. In other words, DTDs let you define the schema for your documents. These schema can then be shared with others so that they can interpret the meaning of your elements and attributes, and more importantly, validate your XML data. Even when DTDs are not used in the actual processing of a document, they can be useful in documenting its element and attribute types. DTDs are also required if you go beyond the basics of elements and attributes and plan to use entity replacements, enumerated lists, or name tokens.
The problem with DTDs is that they aren't sufficient for describing data. Borrowed directly from SGML, DTDs use an extended Backus-Naur Form (BNF) syntaxa formal mathematical way to describe a languagethat's sufficient for describing traditional document structures. Unfortunately, large-scale document management is not where XML has been popping up. Rather, XML is being used in lightweight applications to describe messages passed among applications, program structures, database tables, and even file formats. To describe such orientations properly, we need (at a minimum) the ability to associate data "types" with certain kinds of data. In other words, it's useful to distinguish a date from a string, or a floating-point number from an integer.
As you probably know, the XML Schema specification is nearing recommendation status within the W3C. Unfortunately, the recommendation has been slow in coming.