Create a DTD for your Blog

Assignment 3 — XML Foundations Fall 2008

Assigned: Thursday, September 18th, 2008
Due: Thursday, September 25th, 2008


Think about how to formalize the rules that describe your blog. The ideal DTD strikes the perfect balance between being too restrictive and too permissive. The design spectrum can be explored most easily by trying to create a varied set of sample entries.


The DTD should reflect the conceptual model of your blog idea from Assignment 1, and of course the XML created in Assignment 2 must validate against the DTD. Create a document type declaration which establishes the connection between the XML document and the DTD. To make the DTD as good as possible (given the rather small scenario that you will be working on), the following criteria must be satisfied:

  1. You must include something in your scenario that uses ID/IDREF attributes. These can be links between blog entries (the simplest case) or more challenging scenarios like the one we discussed in class.
  2. You must use mixed content somewhere.
  3. You must use parameter entities for concepts that you reuse (element content or attributes).
  4. Data types must be based on parameter entities and you should represent data types this way.
  5. Use as many comments as possible to capture all constraints that cannot be expressed in the DTD (this is particularly important so that the switch to XSD will be easier).

If you have any question how these criteria apply to your scenario, please feel free to ask me. If you want to look at examples, the XHTML DTD that is used for many examples in the lecture slides is an excellent example for a well-designed DTD.

Submit your DTD and the XML instance document that can be validated against your DTD.

Creative Commons License Please send comments to
Last modification: Monday, 02-Feb-2009 01:00:13 EST
valid CSS! valid XHTML 1.0!