Subject: | XML::Twig generating extra close tag |
An extra close tag is generated by the following code:
use XML::Twig;
my $org = <<XML;
<XXX>
</XXX>
XML
print "XML::Twig version $XML::Twig::VERSION\n";
my $twig = XML::Twig->new (
twig_roots => {'head' => \&editNode,},
twig_print_outside_roots => 1
);
$twig->parse ($org);
$twig->flush ();
sub editNode {
my ($t, $elt) = @_;
$t->flush ();
}
the extra tag is not generated if the flush call following the parse
call is not made.