There are several methods for supplying a DTD. You can include a DTD in an XML document like this:
<?xml version="1.0"?> <!DOCTYPE configuration [ <!ELEMENT configuration . . .> more rules . . . ]> <configuration> . . . </configuration>
As you can see, the rules are included inside a
DOCTYPE declaration, in a block delimited by
[. . .]. The document type must match the name of the root element, such as
configuration in our example.
Supplying a DTD inside an XML document is somewhat uncommon because DTDs can grow lengthy. It makes more sense to store the DTD externally. The
SYSTEM declaration can be used for that purpose; specify a URL that contains the DTD, for example:
<!DOCTYPE configuration SYSTEM ...