my $parser = XML::Parser->new(ErrorContext => 2, Style => "Tree"); my $xso = XML::SimpleObject->new( $parser->parse($content) ) or die "c +ould not parse!"; foreach my $form($xso->children()) { check_tag($form); } sub check_tag{ foreach my $tag($_[0]->children()) { print $tag->name." ".$tag->value."\n"; check_tag($tag); } }
In reply to looping over xml by Micz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |