use strict; use warnings; use XML::Twig; my $tw = XML::Twig->new( TwigHandlers => { 'NBA/HomeTeam' => \&nba } ) +; $tw->parse(<<__XML__); <NBA> <HomeTeam href="Celtics"/> <VisitorTeam href="Bulls"/> <Stadium id="FleetCenter">blabla</Stadium> </NBA> __XML__ $tw->flush; sub nba { my ( $twig, $nba ) = @_; $nba->set_att( href => 'MyHomeTeam' ); $twig->flush; }
In reply to Re: extracting href data in XML
by borisz
in thread extracting href data in XML
by kanz0r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |