Subject: | root not triggering when ignore_elts specified |
If you have a handler for root, it is never triggered if you specify
ignore_elts.
This worked in 3.26 and before, broke in 3.28.
Subject: | test.pl |
use XML::Twig;
$a="
<xtvd schemaVersion='1.3'>
<station id='10035'/>
<schedules>
<schedule station='10035'/>
</schedules>
</xtvd>
";
print "\n\nTrying with ignore_elts\n";
$twig=XML::Twig->new(
ignore_elts => { schedules => 1 },
twig_handlers =>
{
xtvd => sub { print "Got xtvd\n"; },
station => sub { print "Got station\n"; },
});
$twig->parse( $a);
print "\nTrying without ignore_elts (why didn't xtvd trigger above?)\n";
$twig=XML::Twig->new(
# ignore_elts => { schedules => 1 },
twig_handlers =>
{
xtvd => sub { print "Got xtvd\n"; },
station => sub { print "Got station\n"; },
});
$twig->parse( $a);