DTDs and XML Documents

Writing the DTD is a very fine and noble endeavor; however, it's a complete waste of time if you don't link the DTD somehow to your XML document.

The linking of the two documents actually occurs in the XML document, not in the DTD. This is because most XML-based languages have only one DTD. That DTD is used by many different documents, so specifying the link in the DTD would become difficult to manage.

Instead, the link is created in the XML document through the DOCTYPE declaration. The DOCTYPE declaration is actually pretty flexible in that it enables you either to specify a reference to an external file that contains the DTD, or actually to include the DTD within the XML document itself, inside the DOCTYPE declaration. ...

Get Special Edition Using XML, Second Edition 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.