CSC498 - Semantic Web - Homework 2 - Fall 2005

Nadeem Abdul Hamid - Berry College

In your previous homework, you were asked to define a DTD and produce an XML document for a fake bookstore. Even though different bookstores should be very similar, the flexibility of XML allowed one to create very different DTDs. Assume now that you are a bookstore customer, and you want to compare bookstores. In order to compare them, you need to transform the data into a common format.

In this assignment, you are to write a program that takes as input the XML files of two different bookstores, and outputs the combined data in the format of a third DTD.

The two input files (and their DTDs) are:

The output should be an XML file that is valid with respect to the following DTD:

Don't forget to inlcude this DTD in the external subset of the output file.

Your program should use the parser class(es) in the standard Java library. How you produce the output file is up to you. Your program must be capable of converting similar XML files that use the same DTDs as the sample input files. However, you can assume that a consistent style is used in these files. In particular, you can assume that no entity references are used in any files. Note, before you write your program, you will have to determine which elements and attributes in the input files correspond to which elements and attributes in the output files. Sometimes, an input file may not explicitly contain the required information, but it can be inferred from its structure or comments.

Submission

This assignment is due by 5PM, Monday, September 26, 2005. Please send it to me by e-mail. Your grade will be based primarily on correctness of your Java program.

 



Berry College