Assignment 2 - Weblog Schemas

DTD Schemas

Consider the weblog from the first assignment, but without any namespace qualifications.
  1. Add a DTD declaration and use your favorite tool to validate the weblog against this DTD.
  2. Try to validate the weblog with the following modifications and explain the results (valid? (why?), non-valid? (why not?))
    1. no email address
    2. an email address written inside the url tag
    3. A paragraph tag p inside a paragraph tag p
    4. A paragraph tag p inside a bold tag b
  3. Give examples of small valid weblogs, where the DTD schema allows too much.
  4. Change the DTD such that a local entity declaration is used to reuse the common part of the text, p and li elements.

XMLSchema

    In this part of the assignment you are asked to develop an XMLSchema for the weblog language.
  1. First write an XMLSchema in which all declarations (except weblog) and type definitions are local, for which this simple weblog is valid (add a schemaLocation and check validity with your favorite tool). In particular, it is ok only to allow text inside the text tags. Your schema should however still be general, e.g. allowing arbitrary dates, an arbitrary number of items (also none). As for the DTD above, the email and url should be optional.
  2. Change your schema such that it uses some global declarations and definitions.
  3. Extend your XMLSchema (and the weblog language) to allow an optional <date> element in the end, containing a text (with simple type date). The idea is that this element contains the date and time of the last update. Try to use a type extension to extend the type of the weblog. Note that this is an example of an XML language with two different uses of the date tag.
  4. Extend your XMLSchema to allow XHTML tags (with explicit xhtml qualification) inside the text tag using the any construction. Verify that this weblog is valid.
  5. Add a key definition to your schema ensuring that there can only be one item with the same date. Verify the above weblog again. Try to add an item such that you have two items with the same date and verify that the weblog is no longer valid.

Guidelines for the report

This is a small programming assignment, so you are not expected to do an analysis.
Thomas Hildebrandt
Last modified: Mon Mar 21 20:10:57 CET 2005