Where Is the DTD Used?

Because the DTD is a machine-readable document, it is part of your finished system, enforcing the rules set forth in it and assisting different application components in dealing with your XML instances. For example, an application environment might use a DTD to create object classes based on the elements in its DTD. Any text editor or word processor can be used to edit XML documents, but structured XML editors use the DTD to enforce compliance at the input level, restricting authors from using invalid XML codes. Likewise, your application can “validate” individual XML instances against the DTD to ensure that they conform. This is especially important when you're accepting XML from external sources (such as other businesses) ...

Get XML and SQL: Developing Web Applications 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.