Assignment 2 - Weblog Schemas
DTD Schemas
Consider the weblog
from the first assignment, but without any namespace qualifications.
- Add a DTD declaration and use your favorite tool to validate the weblog against this
DTD.
- Try to validate the weblog with the following modifications and
explain the results (valid? (why?), non-valid? (why not?))
- no email address
- an email address written inside the url tag
- A paragraph tag p inside a paragraph tag p
- A paragraph tag p inside a bold tag b
- Give examples of small valid weblogs, where the DTD schema allows
too much.
- 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.
- 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.
- Change your schema such that it uses some
global declarations and definitions.
- 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.
- 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.
- 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.
- Write in english.
- Put all your programs in one folder (must be a subfolder of your public_html) and write in the report
where to find the folder.
- In the folder you must put a README textfile that describes what each file does.
- The report must include prints of programs and sreendumps to document your work.
- The report must include a description of which parts of the assignment were solved and which were not, plus
comments to this (especially if there were parts that you could not solve). One or two pages should be enough.
- Remember to write your names and the group number on the report.
- The report can either be handed in to your instructor or put in the pigeon-hole outside the
study administration on the 1. floor. No later than wednesday, April 6th, 12:00.
Thomas Hildebrandt
Last modified: Mon Mar 21 20:10:57 CET 2005