in reply to Re^3: trying to understand xml::twig and also trying to learn how to extract attribute
in thread trying to understand xml::twig and also trying to learn how to extract attribute
my @ids; my $t = XML::Twig->new(); $t->parse($xmlStr); for my $one ($t->root()->children('one')) { if ($one->first_child('traffic')->first_child('monthly')->att('val +ue') eq 'on') { push @ids, $one->att('id') } } print Dumper(\@ids); __END__ $VAR1 = [ 'movies', 'espn' ];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: trying to understand xml::twig and also trying to learn how to extract attribute
by convenientstore (Pilgrim) on Nov 05, 2008 at 22:31 UTC | |
by convenientstore (Pilgrim) on Nov 06, 2008 at 15:03 UTC |