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:
External DTD:
You can put the DTD in a separate file from the
XML file, and refer to it using a
<!DOCTYPE ...>
line at the beginning of the XML file. The
advantage of this method is that many XML files
can all refer to the same DTD.
Internal DTD:
You can put the DTD inside the
<!DOCTYPE ...>
declaration at the front of the XML file. The
advantage of an internal DTD is that the file
can be validated by itself, without reference
to any external files.
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
is the name of the root (highest-level) element of the
document, and
root-name
is the name of the file containing the DTD.dtd-name.dtd