http://qs321.pair.com?node_id=788383


in reply to Perl XML

I use XML::LibXML with great results.
Try this (untested):
use XML::LibXML; #Parse XML my $template = 'xmldocument.xml'; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file($template); #Find desired node(s) my @nodes= $doc->findnodes("//genre"); #Put results in array my @information; for(@nodes) { my $data = $_->textContent; push (@information,$data); }
This puts the text from all the "genre" nodes into an array.