CSCI 5733
XML Application Development
Summer 2003
Homework #1

Due date: June 3, 2003

(1) Write a CGI-Perl program h1.pl that serves as a simple Web-based XML server to serve up quotations.

The program uses two input sources:

URL : http://dcm.uhcl.edu/yue/courses/xml/Summer2003/hw/h1dat1.csv: CSV file.

URL: http://dcm.uhcl.edu/yue/courses/xml/Summer2003/hw/h1dat2.xml: XML file.

The CSV (comma separated list) file uses the format of MS-DOS CSV file format of MS Excel. Study the format carefully, especially for the special characters " and ,. Note that in MS-DOS CSV, \ is not used as a special character.

The first line of the CSV file contains the names of the fields.

Both CSV and XML files have four fields:

In the input XML document, quote is the body of the element <quote> and the three other fields are attributes of <quote>

Your CGI-Perl program may accept up to three HTTP parameters: author, subject and ranking.

If no HTTP parameter is supplied, your program returns XML containing all quotations from the CSV and XML document.

For the contents of h1dat1.csv and h1dat2.xml

http://dcm.uhcl.edu/youraccount/h1.pl should return this output.

If HTTP parameters are supplied, the following examples explain what you should exactly return:

http://dcm.uhcl.edu/youraccount/h1.pl?author=Bun+Yue should return this output.

http://dcm.uhcl.edu/youraccount/h1.pl?author=Bun+Yue&subject=Computer+Science should return this output.

http://dcm.uhcl.edu/youraccount/h1.pl?author=Bun+Yue&subject=Computer+Science&ranking=8 should return this output.

Study the output very carefully to ensure the proper output.

Naming mechanism should be followed strictly in order for the teaching assistant to test run your program. Do not use any XML parser.

Turn in:

(2) [10%] Give a minimal DTD that describes the output XML document format.