Skip to Content
XML and Perl
book

XML and Perl

by Mark Riehl, Ilya Sterin
October 2002
Intermediate to advanced content levelIntermediate to advanced
400 pages
9h 40m
English
Sams
Content preview from XML and Perl

Exercises

  1. 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 
  2. 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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Perl and XML

Perl and XML

Erik T. Ray, Jason McIntosh
Programming Web Services with Perl

Programming Web Services with Perl

Randy J. Ray, Pavel Kulchenko
Mastering Perl

Mastering Perl

brian d foy
Perl by Example

Perl by Example

Ellie Quigley

Publisher Resources

ISBN: 0735712891Purchase book