Practice Problem 6: Reading/Writing XML files, due Thursday, 11/30
Objective: To add the ability to read and write XML files to Practice Problem 4
Here are the details and rules:
- Start with a working solution to Practice Problem 4.
- Add 3 buttons, like this program (If link doesn't seem to work, right-click on
it and select "Save Target As", then execute the program after saving it.)
- The "Save" button should save both schema information and row data to two different XML files (the
schema info will be in an XSD file)
- The "Load Schema" button should make the DataSet reference variable refer to a new, empty DataSet
(call the constructor again) and then load the schema from the XSD file into the DataSet, displaying an
error message if the file is not found (not crashing). If that file is not found, make sure the DataSet
gets setup properly anyway (in code, as it was in PP4).
- The "Load Data" button should clear all rows from all tables of the DataSet, leaving the schema
intact. (Call Clear()) It should then load all the rows from the XML file into the DataSet and update the
display accordingly. It also should not crash if the file is not found.
- No database access is necessary for this program.
- Use a DataSet to store the data, and that DataSet should be created in code that you write.
- When turning in your homework, zip up your entire solution and example XML files it produced
and e-mail the zip file to cpersiko@ccsf.edu
Return to main CS 112D page