Washington University
Construction and Pedagogical
Use of Digital Archives
22 May-3 June 2006

David L. Gants
University of New Brunswick


DTD Key Points

Note: In the example listed in this set of related documents, a courier face means the characters should be typed as is, while an italic Times Roman indicates a variable.

1. Basic Rules Refresher

To be well-formed, an XML document must obey these rules:

The XML declaration looks like this:
<?xml version="1.0"?>
The Cascading Stylesheet declaration follows the XML declaration but precedes the root element.

Observe the following naming conventions when creating tags:

2. Document Type Definitions (DTD)

In order to be valid, an XML document must have an accompanying DTD. The DTD may be included within in the XML document after the XML declaration and before the root element:

The DTD may exist as a private, external file referred to in a doctype declaration from within the XML document, after the XML declaration and before the root element. The keyword "SYSTEM" indicates a private DTD used by a single author or group: The TEI was created as a public consortium and distributes its guidelines and software for wider use. When using public DTDs such as those created by the TEI, the doctype declaration employs the keyword "PUBLIC" and includes the specific name of the DTD: The sample TEI-Lite template contains the complete doctype declaration. For more complex project, the TEI has created a tripartite set of DTDs: These auxiliary DTDs are invoked by declaring the appropriate parameter entity within square brackets and with the replacement text "INCLUDE". The CEWBJ uses this protocol.

When declaring elements and attributes, use the following symbols to indicate relationships:

3. Element Declarations

Element declarations take the following form:

The Content Model may contain: 4. Attribute Declarations

Attribute declarations take the following form:

Attribute types can have the following values: Default types can have the following values: There are two predefined XML attributes, both of which begin "xml:".  You must declare them for each element in which you plan to use them: 5. Entity Declarations
 
Document-level entity declarations take the following form: Within a DTD, parameter entities take the following form: