use strict; use XML::Twig; my $twig = new XML::Twig(TwigHandlers=> {NBA=>\&NBA}); $twig ->parsefile('nba.xml'); exit<p> sub nba { my ($twig, $nba)=@_; $nba{stadium}= join ':', map {$_->text || ''}@{[$nba->children( 'S +tadium')]; print "$nba(stadium)\n"; $nba ->delete; }
In reply to Re^2: extracting href data in XML
by kanz0r
in thread extracting href data in XML
by kanz0r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |