Programming Assignment 7
Using XPath and XSLT

Due on Thursday April 16 before midnight


The goal of this project is to learn XPath and XSLT to query XML data.

This project must be done individually. No copying is permitted. Note: We will use a system for detecting software plagiarism, called Moss, which is an automatic system for determining the similarity of programs. That is, your program will be compared with the programs of the other students in class as well as with the programs submitted in previous years. This program will find similarities even if you rename variables, move code, change code structure, etc.

Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Just do your project alone using the help given in this project description and from your instructor and GTA only.


You will do this project on your own PC/laptop. You may use a text editor to develop your Java programs but you may use an IDE, such as Eclipse or Netbeans, if you want.

Here are some examples:


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

Project Requirements

    You will evaluate XPath and XSLT over XML data from the API (the eBay Commerce Network API) for shopping, which you used in Project #3. More specifically:
    1. Write a Java program that reads some search keywords from input, searches the eBay API for items in the category with id=72 (the computers category) that match these keywords, and displays information about these products by evaluating the following XPath queries over the returned XML data:
      1. Print the full description of all products that have a rating 4.50 or higher.
      2. Print the name and the minimum price of all products whose name contains the word Sony.
      3. Print the names of all products whose name contains the word Sony and the price is between $1000 and $2000, inclusive.
    2. Write an XSLT program search.xsl to display the search results by transforming the XML result to XHTML using XSLT so that it looks like the HTML page you generated for the search results in Project #3. Use the Java program to test your XSLT and then load the resulting html output file on your web browser.

    Note: To call a web service, use the class. To URL-encode the query string, use the class. For example, this calls the ISBN DB and prints the result.

What to Submit

Use the form below to submit your files:, search.xsl,, and a sample of your HTML output of your program.

Submit Project #7:

Last modified: 04/07/2015 by Leonidas Fegaras