External DTDs

The DTDs I've created in this chapter so far have all been built into the documents they are targeted for. However, you can also create external DTDs, in which the actual DTD is stored in an external file (usually with the extension .dtd).

Using external DTDs makes it easy to create an XML application that can be shared by many people. In fact, that's the way many XML applications are supported. There are two ways to specify external DTDs: as private DTDs or as public DTDs. I'll take a look at private DTDs first.

Private DTDs are intended for use by people or groups privately and are not intended for public distribution. You specify an external private DTD with the SYSTEM keyword in the <!DOCTYPE> element, like this (note also that ...

Get Real World XML 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.