The eXtensible Markup Language (XML)
Assignment #5
Due 1:00pm, August 16, 2001.
-
Make a directory $HOME/csceXML/a5 for
this assignment.
% mkdir
$HOME/csceXML/a5
% chmod
0700 $HOME/csceXML
-
Create a program using whatever XML
technologies that you prefer to retrieve selected fields from the file
sampledata.xml.
This XML file contains a list of class elements with sub-elements:
callnumber
title
coursenumber
credits
section
time
days
room
instructor
An example record from the file is:
<class>
<callnumber>2695</callnumber>
<title>Computer
Science Fundamentals</title>
<coursenumber>101
</coursenumber>
<credits>003</credits>
<section>001</section>
<time>0200-0315P</time>
<days>TR</days>
<room>Ferg
217</room>
<instructor>Riedesel</instructor>
</class>
The user should be able to give
the program the name of the file and the fields to be selected. The
program should return an XML file with only the selected fields.
For the example record, selecting the coursenumber and title fields would
yield:
<class>
<coursenumber>101
</coursenumber>
<title>Computer
Science Fundamentals</title>
</class>
-
For extra credit, you may implement
a filter on the fields so that only the selected fields from the class
elements that pass the filter are returned. This is similar to the
SQL where filter.
-
Write a brief report summarizing your
program. Describe the approach that you took (including what technologies
you used) and explain your decisions.
-
Use the handin program to submit your
program files and a README file telling how to run it. Print out
your report and submit it in class.