Programming Assignment 6
Using XPath, DOM, and SAX

Due on Thursday March 28 before midnight


Description

This project must be done individually. No copying is permitted. The goal of this project is to learn XPath and XSLT to query XML data and display XML data on a web browser.

Platform

You will do this project on your own PC/laptop. You may use a text editor to develop your Java programs but you can use Eclipse if you want.

Here are some examples:

Documentation

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

Project Requirements

  1. Download the file xpath.java and edit it to include the following XPath queries. First, download the following XML document along with its DTD that describes journal articles: Insert XPath queries in xpath.java that answer the following:
    1. Print the titles of all articles whose one of the authors is David Maier.
    2. Print the titles of all articles whose first author is David Maier.
    3. Print the titles of all articles whose authors include David Maier and Stanley B. Zdonik.
    4. Print the titles of all articles in volume 19/number 2.
    5. Print the titles and the init/end pages of all articles in volume 19/number 2 whose authors include Jim Gray.
    6. Print the volume and number of all articles whose authors include David Maier. (note: we need the number entry of an article, not the number of articles).
  2. Consider the following XML document along with its DTD that describes recipes: Write an XSLT program to display the recipes nicely on a web browser. The XSLT should generate HTML code. You should display all data except the related elements. Use the Java program xslt.java to test your XSLT and then load the resulting html output file on your web browser.

What to Submit

Use the form below to submit your files.

Submit Project #6:


Last modified: 03/19/13 by Leonidas Fegaras