OK, so I'm new to handling XML in Perl.
I think I've got most of what I need figured out, but I'm running into some
difficutly in handling one situation.
Each DOC has more than one KEYWORD entry.
How do I pull out multiple KEYWORDs from this XML file using this style
code?

use XML::XPath;
my $file = "blah.xml";
my $xml = XML::XPath->new(filename => $file);
print "<p>\n";
foreach my $item ($xml->find('//DOC')->get_nodelist){
print $item->find('NUMBER')->string_value."<br>\n";
print $item->find('KEYWORD')->string_value."<br>\n";
}
print "</p>\n";

Also, does anyone know of any good site(s) for Perl XML::XPath
syntax/examples?
Thanks a lot.
--Alex
 
_______________________________________________
Boston-pm mailing list
Boston-pm@mail.pm.org
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to