xmltwig01.pl to HTML.

index -|- end

Generated: Tue Feb 2 17:55:01 2010 from xmltwig01.pl 2006/07/25 385.

#!/Perl
use XML::Twig;
my $file = 'camelids01.xml';
my $twig = XML::Twig->new();
$twig->parsefile($file);
my $root = $twig->root;
foreach my $species ($root->children('species')){
    print $species->first_child_text('common-name');
    print ' (' . $species->att('name') . ') ';
    #print $species->first_child('conservation')->att('status');
    print "\n";
}

index -|- top

checked by tidy  Valid HTML 4.01 Transitional