Next / Previous / Contents / TCC Help System / NM Tech homepage

2. Where does a DTD live?

A Document Type Definition lives in a file whose name ends with .dtd. Inside this file are items that define tags (elements), attributes, and other beasties to be named later.

There are two ways to connect a DTD with the content of an XML file:

2.1. Linking an XML file to an external DTD

If your XML file is supposed to conform to an external DTD, place a declaration of this form at the beginning of the XML file:

    <?xml version="1.0"?>
    <!DOCTYPE root-name SYSTEM "dtd-name.dtd">

where root-name is the name of the root (highest-level) element of the document, and dtd-name.dtd is the name of the file containing the DTD.