Programming Assignment 5
XML Design using DTD and XML Schema

Due on Thursday October 30 before midnight


The goal of this project is to learn how to describe XML data using DTD and XML Schema. More specifically, you will use XML to describe bibliography data, create a sample XML document, describe it using DTD and XML Schema, and validate it.

This project must be done individually. No copying is permitted. Note: We will use a system for detecting software plagiarism, called Moss, which is an automatic system for determining the similarity of programs. That is, your program will be compared with the programs of the other students in class as well as with the programs submitted in previous years. This program will find similarities even if you rename variables, move code, change code structure, etc.

Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Don't try to hire a freelancer to do the coding for you. Just do your project alone using the help given in this project description and from your instructor and GTA only.


You will do this project on your own PC/laptop. You may use Eclipse or Netbeans if you like, but is not required. Here are some examples:

You may validate your XML document against your DTD and XML Schema using Java.


The following web pages provide some tutorials. Use them as a reference only.

Project Requirements

Consider the following Entity-Relationship (ER) diagram:

Based on this ER diagram, do the following:

  1. Create a DTD that captures all this information. Avoid data redundancies (do not duplicate data, except keyrefs/idrefs). You may use IDs/IDrefs in DTD. You may introduce your own ids (ID/IDRefs can hold alphanumerical values only).
  2. Create a small XML document that matches your DTD.
  3. Validate your XML document against your DTD.
  4. Create an XML Schema that matches your XML document. You must define all keys/keyrefs.
  5. Validate your XML document against your XML Schema.
Note (10/30/2014): Please ignore keys and keyrefs. You may define the ids/idrefs as plain attributes in XML Schema. (But of course, you need to define id/idrefs in the DTD though.)

What to Submit

Use the form below to submit your files.

Submit Project #5:

Last modified: 10/21/2014 by Leonidas Fegaras