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

Parsing an XML Document and Extracting Statistics

Now that you’ve got a good understanding of what it means to parse an XML document, let’s take a look at a short example that uses one of the tools that were just discussed. For this example, we’ll use the XML::Parser Perl module to parse a small XML document. Listing 2.1 shows a small XML document that contains statistics from two great baseball players. As you can see, the XML document is very simple. It has two <player> elements, and each <player> element has four child elements (<name>, <team>, <home_runs>, and <batting_average>). Granted, this is a small and simple XML document, but it is perfect for illustrating simple XML parsing. Our goal for this example is to parse this document ...

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