in reply to Perl and XPath.
getNodeValue method will give you the authors name.
#!/usr/bin/perl use warnings; use strict; my $a = do {local $/; <DATA>}; use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(xml => $a); my $nodeset = $xp->find('//@author'); # find all authors foreach my $node ($nodeset->get_nodelist) { print $node->getNodeValue."\n\n"; }
Regards,
Murugesan Kandasamy
use perl for(;;);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Perl and XPath.
by Anonymous Monk on Aug 02, 2007 at 22:00 UTC |
In Section
Seekers of Perl Wisdom