i have tried the following code:
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;
}
CODE tags added by Arunbear |