San José Estépar Raul #### my $xml; open (SOURCE, $source_file) or die "ERROR: Cannot open filehandle to read $source_file: $!\n"; { local $/; $xml = ; } close(SOURCE) or die "ERROR: Cannot close filehandle on $source_file: $!\n"; print $xml; #### my $xp = XML::XPath->new(xml => $xml) or die "ERROR: XML::XPath cannot parse target file: $!\n"; my $contrib_nodeset = $xp->find('/contrib[@contrib-type="author"]'); foreach my $contrib_node ($contrib_nodeset->get_nodelist) { my $given_names = $xp->find('./name/given-names', $contrib_node); my $surname = $xp->find('./name/surname', $contrib_node); print "CONTRIB: $given_names $surname\n"; }