Converting a DTD to XSD and Adding Simple Types

Assignment 7 — XML Foundations Fall 2010

Assigned: Tuesday, November 9th, 2010
Due: Friday, November 19th, 2010

Introduction:

XSD supports a much more elaborate type system than DTDs. In this assignment, the goal is to convert an existing DTD to an XSD, and to refine the XSD by adding specific simple types, some of which has to be derived simple types.

Instructions:

In this assignment, the goal is to create an XSD for the XML document, and to design some simple types that capture the constraints for the XML document as narrowly as possible. Start by converting the DTD to an XSD, using the functionality of the XML editor you are using. Clean up the resulting XSD by using reasonable naming conventions for all types, and by deciding on a design pattern (named vs. anonymous types and local vs. global elements). Then focus on the simple types and refine the generated type definitions by adding facets (or additional types) to create your own simple types. Try to capture as many constraints as possible in those facets, so that validation according to the XSD will reveal as many potential problems in the XML as possible.

Before you submit your XSD, please make sure that it satisfies all of the following requirements:

  • Your XML must validate against the XSD.
  • Your XSD must use one of the four main design patterns discussed in class (russian doll, salami slice, venetian blinds, garden of eden), and you must briefly explain why you chose that design pattern and what you had to change to make the XSD adhere to it.
  • Your XSD must have well-designed simple types in it, where you try to constrain the allowed content of the XML as much as possible. Define your own simple types and use those for attributes and element content. You might even attempt to create your own type hierarchy (deriving from your own types), but this last part is optional.
  • For one of the simple types you have defined, describe all of the facets you were using, and why you were using them, and what kind of constraints you were capturing with the. Also describe one case where you were not able to encode a constraint in XSD, and what the problem was.

Please send the XML and the XSD to dret@berkeley.edu. Please send plain text email with these files as attachments. HTML emails will not be accepted.


Creative Commons License Please send comments to dret@berkeley.edu
Last modification: Tuesday, 21-Dec-2010 03:22:21 CET
valid CSS! valid XHTML 1.0!