91-22-29204260/61

info@ibruk.in

Structured Authoring: A Sample DTD

iBruk Consulting > Tutorials > Structured Documentation > Structured Authoring: A Sample DTD

In the four posts in this series that explains Structured Authoring looked at:

  1. Understanding Structured Authoring
  2. Structured Authoring: Introducing XML
  3. Structured Authoring: Defining the Content Structure
  4. 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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: