CIT 597 Assignment 3: SAX Printer
Fall 2006, David Matuszek

Purposes of this assignment:

General idea of the assignment:

Use a validating SAX parser to read in your XML file from the previous assignment. Display it with the tag and attribute information in one column and the content in another.

Input XML Output (on screen)
<?xml version="1.0"?>
<novel>
  <title>
    In the Dark
  </title>
  <foreword>
    <paragraph>
      This is the great American novel.
    </paragraph>
  </foreword>
  <chapter number="1">
    <paragraph>
      It was a dark and stormy night.
    </paragraph>
    <paragraph>
      Suddenly, a shot rang out!
    </paragraph>
  </chapter>
</novel>
title   
novel
foreword
paragraph   
chapter
  number="1"
paragraph   
paragraph   
In the Dark
 
 
    This is the great American novel.
 
 
    It was a dark and stormy night.
    Suddenly, a shot rang out!

Details:

Use Swing to put a basic GUI on the screen. It need only consist of a button or menu item to click in order to choose a file, and a large scrollable text area in which to display the result. Use a JFileChooser to choose the file to be read. (If you need help with Swing, see my SwingExamples.jar program.)

Use SAX to read in an XML file, and display it as in the example above.

If necessary, you may make minor changes to your XML and DTD. For example, if you have any mixed content, eliminate it. If you did not use any attributes, add some.

Due date:

October 2, before midnight. Email the URL to both me and my grader. Zip all relevant files and submit them via Blackboard.