Limitations of DTDs

DTDs were inherited from SGML (Standard Generalized Markup Language). In SGML, they were used to constrain the structure of the content of documents, and essentially the same technique was defined in the XML 1.0 Specification as the means to constrain XML documents.

If you look back at the description given earlier in this chapter of what can go in a DTD, you see that it defines, for example, that an element can contain (or not) elements or character data. That is a very useful constraint when dealing primarily with documents, which has been SGML's primary focus. However, as developers have begun to explore the potential of XML, they have found that not only is it useful for documents, but it also has enormous potential for ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.