October 2002
Intermediate to advanced
400 pages
9h 40m
English
Given the CSV data shown in the following, create a file named exer_1.csv. Write a Perl program using the XML::SAXDriver::XML module that will convert the CSV file to XML.
Name the root element <exercise1> and then use the first column names as the element names (hint: Dynamic_Col_Headings). Use the XML::Handler::YAWriter as the event handler. Generate a new file named exer_1.xml containing the results.
Class,Teacher,Time,Room,Lab Biology,Mrs. Riehl,10:00 − 11:00,103,Y Marine Science,Mrs. Riehl,11:30 − 12:30, 103,N Algebra,Mr. McCarthy,1:00 − 2:00,114,N Computer Science,Mr. Burns,3:00 − 4:00,204,Y
Now modify the program and write your own handler to handle the CSV data. Don’t forget to take out the XML::Handler::YAWriter dependency ...