Skip Menu |

This queue is for tickets about the XML-Twig CPAN distribution.

Report information
The Basics
Id: 24392
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: Nobody in particular
Requestors: rmeden [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.28
Fixed in: (no value)



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);
On Tue Jan 16 00:50:39 2007, REDEN wrote: Show quoted text
> 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.
Indeed, that's a bug. I have a patched version here, I will put it on http://xmltwig.com on Monday (I am away and the site is down at the moment). Let me know if you need the patched version earlier, I can email it to you. I will release a new version early next week too. Thanks for spotting this. __ mirod
From: REDEN [...] cpan.org
On Thu Jan 18 16:59:52 2007, MIROD wrote: Show quoted text
> I have a patched version here, I will put it on http://xmltwig.com on > Monday (I am away and the site is down at the moment). Let me know if > you need the patched version earlier, I can email it to you.
No need to email it... the older versions work fine for me. I was alerted to the problem when one of my users did an auto-update and the new module broke my code. ( a US TV listings grabber, tv_grab_na_dd in http://xmltv.org ) Once you upload a new version to CPAN, the trouble reports should stop. Thanks for the module! Robert