The Basic DTD
May 3, 1999
The simplest usage of a DTD involves actually adding the DTD into
the prolog portion of your XML document, just after the XML
processing instruction.
The skeleton (not quite valid) of a DTD looks something like
the following:
<?xml version = "1.0" encoding="UTF-8" standalone = "yes"?>
<!DOCTYPE ROOT_ELEMENT_NAME [
ELEMENT_DEFINITIONS_GO_HERE
]>
BODY_GOES_HERE.......
In this case we declare a document with a root element called
ROOT_ELEMENT_NAME. For example, we might use the following
syntax for our CONTACTS document:
<?xml version = "1.0" encoding="UTF-8" standalone = "yes"?>
<!DOCTYPE CONTACTS [
ELEMENT_DEFINITIONS_GO_HERE
]>
BODY_GOES_HERE.......
The Prolog and The Body
Introduction to XML For Web Developers | Table of Contents
Element Type Declarations (ETDs)
|