|CIT 597 Assignment 2: XML-Based Browser Helper
Fall 2003, David Matuszek
Purposes of this assignment:
Idea of the assignment:
In the previous assignment, you wrote a Browser Helper that created an HTML page or added information to an existing HTML page that your program had created earlier. This information consisted of:
In this assignment, you are to write a revised version of your Browser Helper that produces XML output, rather than HTML output. Your XML should contain all the content information, as above. In addition to the XML, you need:
Sadly, this program is less useful than the first assignment. This should be no surprise. The Browser is designed for use by humans, and HTML is designed for humans, but XML is designed for computers. It may be that, later in the course, we will write programs to process the output of your XML Browser Helper.
How good is your programming style? If you can easily replace the HTML generation
with XML generation, either by replacing a single class or by replacing one
or two methods, then you did the first assignment properly. If you have to totally
revise your program by ripping out
and putting in new ones, then you haven't properly separated the program logic
into replaceable components.
You should probably use an embedded DTD. An embedded DTD means that you have
to have a method or methods to output the DTD code; it's not a lot of extra
work, but is a lot of clutter with
If you use an external DTD, it may not work with your browser. If you can use
an external DTD and figure out how to make it work with both Internet Explorer
and Netscape/Mozilla, that's worth extra credit (I don't know if this is possible.)
I would recommend using an external CSS if possible, but you can use an internal
one if that doesn't work. The advantages of an external CSS are (1) you only
have to write it once, (2) you don't need a bunch of
statements to put it in your XML file, and (3) all your XML documents will have
the same style. The disadvantage of an external style sheet is that all your
XML files will need to be able to find it; this means either (1) all your XML
files must be put in the same directory, or (2) you have to use an absolute
path name--that is not allowed for this assignment (and a terrible idea
in general), because that would make it very difficult for us to use and to
Remember that the Browser Helper in the first assignment could work with multiple files (although only one at a time). Your revised Browser Helper must be able to do the same.
For the XML, invent your own tags. Do not use the HTML tags; use different
names. The names should reflect the structure (content) of the document, and
should not say how it should be displayed. There is one exception: You
can use the
<a> tag with the
for your links.
Finally, don't expect to get output that looks as beautiful as you can produce with HTML.
Wednesday, September 24, before midnight. Turn in a zipped set of files via Blackboard.