S511 Tech Foundations of Net-enabled Organizations

Assignment 2 - XML design and transformation

Due: Monday Oct 4 2004 by 11:59PM

Objectives of this assignment

The primary objective of this assignment is to create an XML schema and stylesheets.

Detailed requirements

In first part of this assignment, you will create an XML schema for a hypothetical document structure. In the second part, you will use the documents you prepared in the first assginment and create stylesheets to provide layout to the documents.

Part 1: Schema

Create an XML schema for a hypothetical XML schema for movies. For the purpose of simplicity, we are going to define a few "business rules" for movies that you should follow, even if they may sound a little too restricting.

  1. A movie has a title, an optional rating (which is one of G, PG, PG-13 and R), a playing length in minutes (whole minutes), a year of production, . A movie might optionally fall in one or more genre (e.g., horror, sci-fi, etc.).
  2. A movie has a director, and a set of casts/roles, and actors who acted in those roles Note that an actor can have multiple roles. An actor or director is a person with a first name, last name, and middle initial.
  3. A movie has a number of scenes (think of scenes as sections that you see in a DVD menu, for example). Each scene has a location and a set of casts which must be from the casts that are defined from this movie. Each scene has a description which is plain text, but can have things in bold, italics and underlined.

Important: Create an XML schema implementing the above business rules. Call this file movie.xsd. Then create a sample XML document using this xsd, to ensure that your movies are valid. In this XML document (call it movies.xml) and include at least 3 movies with some variations in structure.

Part 2: XSLT Stylesheet

Remember the XML documents you created for the e-business catalog for the last assignment? In this assignment you will provide layout to them using XSLT. As we discussed last time, you had put together data from two pages into one XML document. Now is the time to split them and show only specific items from your XML in the pages.

You are going to create TWO XSL stylesheets - one to generate the "list" page, and the other to generate the details page. Lets call the the "list stylesheet" (put it in itemlist.xsl) and the "detail stylesheet" (put it in itemdetail.xsl).

  1. The list stylesheet: In this stylesheet, you will need to reproduce the "list page" in your catalog site. Note that you should only concentrate on the list section of the e-business page, which means you can ignore the navbars, the top and side navigation panels, the bottom footers, and so on. I am only interested in the tabular area where the list of items is shown. In the list page, show only the items from the "favorite category", the category for which you have the most number of items in your XML document. Create a version of your XML document so that it links to this stylesheet that you have just created. Call it items-list.xml. Remember that all the items in the list can be clicked to go to their detail page? Produce links to a page called items-detail.xml.
  2. The detail stylesheet: In this stylesheet, you will need to reproduce the detail page for the first item in your item list. Create a version of your XML document that points to this detail stylesheet, and call it items-detail.xml. Remember that the xml document would have all the items, it is your xsl that should select the first item from your favorite category. Once again, create the layout that you saw in your catalog page for the detailed version of the items, ignoring any navigation bars, active content such as Javascript etc. If the detail page included a form for ordering the item you must generate that form as well, although obviously the form will be non-functional at this point. Note that although ideally this stylesheet should show only the item that you click on from the list page, XML and XSL do not use HTTP parameters, so there isn't a very good way to transfer parameters from one XML/XSL to another. In class we will discuss an alternative with only one XSL that would mimic this option, and you may try it in the assignment, but that is not a requirement for the assignment.

Additional Items

Remember the two special tags you created in your first assignment? Well it is now time to give layout to those as well.

  1. <source> - this tag should generate a disclaimer at the top of your xsl-generated page saying "The data in this page are reproduced verbatim from [the content of your source tag here] for the purpose of a class exercise, with no intention of use of such data for any business intention.
  2. <declaration> - The declaration should show up at the bottom of your xsl-generated pages, centered and italicized, after a horizontal rule, as follows:

I have neither given nor received unauthorized aid on this deliverable.

What to Submit

Before you are ready to submit, MAKE SURE YOU HAVE YOUR NAME and last 4 digits of your ID# on the top of every file (of course, you will need to put them inside comments. You will need to submit the following (follow the naming conventions exactly, otherwise you will not get the credit):

How to Submit

To submit your assignment, follow the steps below:


Individual assignment policy

This assignment is an individual assignment. You are to work on this assignment solely by yourself with no direct help from any other student in the class or outside. You are welcome to post your questions or doubts on the course discussion forums (on Oncourse) as long as that does not involve posting part of whole of your solution. You can email me your questions if you need someone to look at your code. You can ask a fellow student for small help such as help with fixing a parse error, or a doubt about a statement in the assignment. However, the following will be considered violation of the individual policy and you will be penalized if you violate this policy: