in reply to Perl XML
I use XML::LibXML with great results.
Try this (untested):
Try this (untested):
This puts the text from all the "genre" nodes into an array.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); }
|
---|
In Section
Seekers of Perl Wisdom