in reply to Need XMLTwig help
pojmy $t = XML::Twig->new( twig_handlers => { 'Phones'=> \&phones } ); $t->parse($xml); sub phones { my ($t,$elt) = @_; print $elt->parent->att('name');; print ' Phone = ',$t->last_elt('Phone[@name="cell"]') ->att('number'),"\n"; print "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Need XMLTwig help
by McA (Priest) on Aug 22, 2013 at 21:00 UTC | |
|
Re^2: Need XMLTwig help
by perlvroom (Acolyte) on Aug 23, 2013 at 12:53 UTC |