To include the DTD in an XML file, the file should start like this:
<?xml version='1.0'?> <!DOCTYPE
Here's an example of a complete XML file with an
internal DTD that defines two element types: a root element
<park> and a second-level
explain the pieces of the DTD later on.
<?xml version="1.0"?> <!DOCTYPE park [ <!ELEMENT park (trail*)> <!ATTLIST park name CDATA #IMPLIED> <!ELEMENT trail (#PCDATA)> <!ATTLIST trail dist CDATA #REQUIRED climb CDATA #REQUIRED> ]> <park name='Lincoln Natural Forest'> <trail dist='3400' climb='medium'>Canyon Trail</trail> <trail climb='easy' dist='1200'>Pickle Madden Trail</trail> </park>