CSc 4998. Web Programming
Spring 2006, Assignment 4 (XML Parsing and XSLT)
Due: March 31, 2006 (Friday)

This assignment deals with processing and transforming XML files. Consider the r1.xml file containing data related to recipes.
  1. Each student will create data for 5 recipes for a particular cuisine (italian, chinese, etc.). Place this data in your public_html/hw4/ directory under the name file name recipe.xml. Your data should not have the outermost recipes tag. I will combine data from all students into one file called recipes.xml and I will include the outermost recipes tag.
  2. Write a Java application that reads the recipes.xml file using DOM parsing technique. It then presents the following options:
      1. list all recipes (recipe number and title)
      2. enter list of recipe numbers (to calculate calories)
      3. exit
    
    Option 1 simply displays all recipe numbers and titles. Option 2 prompts the user for a comma separated list of recipe numbers. It then prints the number of calories in each along with a total calories in the collection of recipes.
  3. Write XSLT programs to display the recipes in HTML: One program to list all recipe titles in an HTML page and the second program to list a single given recipe. You may need the following servlet that takes two parameters: the XSL file URL and XML file URL and applies the XSL transform to the XML file and sends the output to the browser.

    ProcessXSL.java

    Consolidated recipes.xml file