Structured Authoring: A Sample DTD
In the four posts in this series that explains Structured Authoring looked at:
- Understanding Structured Authoring
- Structured Authoring: Introducing XML
- Structured Authoring: Defining the Content Structure
- Structured Authoring: The Role of the DTD/Schema
In this post, we look at a Document Type Definition (DTD), which is the formal definition of a content structure.
Consider the following image which shows a sample DTD for an email.
This DTD specifies that:
- an email must have three elements; address, subject, and body.
- address must contain one sender and one receiver element.
- the sender must contain one emailaddress.
- the receiver must contain a to element, and an optional cc and/or bcc element.
- the to, cc, and bcc elements must contain one or more emailaddress elements.
- the emailaddress element contains text.
- the subject element contains text.
- the body element must contain a salutation, message, and signature.
- the salutation element contains text.
- the message element must start with a para element.
- After the initial para element, there can be number of para, list, or image elements and in any order.
- the para element contains text.
- the list element must contain one or more listitem elements.
- the list element has an attribute type which can be given the value bullet or number, with bullet being the default value.
- the listitem element contains text.
- the element image is an empty element with a mandatory attribute href which contains text.
- the signature element contains one or more para elements.
- address must contain one sender and one receiver element.