Programming Assignment 6
Due on Thursday March 28 before midnight
Using XPath, DOM, and SAX
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.
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:
The following web pages provide some tutorials. Use them as a reference only.
- 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:
- SigmodRecord.zip (the zipped XML document)
- SigmodRecord.dtd (the DTD of the document). Note: the link is NOT broken. Just right click and use "Save Link As" to save the DTD on your PC.
- Print the titles of all articles whose one of the authors is David Maier.
- Print the titles of all articles whose first author is David Maier.
- Print the titles of all articles whose authors include David Maier and Stanley B. Zdonik.
- Print the titles of all articles in volume 19/number 2.
- Print the titles and the init/end pages of all articles in volume 19/number 2 whose authors include Jim Gray.
- 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).
- 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.
Last modified: 03/19/13 by Leonidas Fegaras