XML::Crawler - Crawl an XML document to create a Perl data structure which resembles the XML data structure.
use XML::Crawler qw( xml_to_ra ); my $array_ref = xml_to_ra( $xml );
This:
<?xml version="1.0"?> <fruit type="banana">yellow</fruit>
Is translated to:
[ '#document' => [ [ 'fruit' => { 'type' => 'banana' } => 'yellow' ] ] ]
<?xml version="1.0"?> <contact-info> <name>Jane Smith</name> <company>AT&T</company> <phone>(212) 555-4567</phone> </contact-info>
[ '#document' => [ [ 'contact-info' => [ [ 'name' => 'Jane Smith' ], [ 'company' => 'AT&T' ], [ 'phone' => '(212) 555-4567' ], ], ], ], ];
XML::LibXML
There are more modules in the XML namespace than one can shake a stick at.
Dylan Doxey, <dylan.doxey@gmail.com<gt>
Copyright (C) 2010 by Dylan Doxey
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install XML::Crawler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Crawler
CPAN shell
perl -MCPAN -e shell install XML::Crawler
For more information on module installation, please visit the detailed CPAN module installation guide.