Skip Menu |

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

Report information
The Basics
Id: 47008
Status: open
Priority: 0/
Queue: XML-LibXML-Iterator

People
Owner: Nobody in particular
Requestors: sjq-perl [...] jadevine.org.uk
Cc:
AdminCc:

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



Subject: nextNode and previousNode fail when filter returns FILTER_REJECT
I have recently been trying to use XML::LibXML::Iterator with XML::NodeFilter. I have found a bug in the implementation of the nextNode() and previousNode() subroutines which basically makes this impossible to achieve. When the NodeFilter accept_node() method returns FILTER_REJECT the while(1) ends up in an infinite loop. The problem is that the iterator function works with the node stored in $self->{CURRENT} (and also refers to $self->{INDEX}). When a value of FILTER_REJECT is returned neither the current node or the index are updated before the next call to the iterator. This results in the iterator code forever returning the same "next" node.
On Tue Jun 16 10:49:29 2009, SJQUINNEY wrote: Show quoted text
> I have recently been trying to use XML::LibXML::Iterator with > XML::NodeFilter. I have found a bug in the implementation of the > nextNode() and previousNode() subroutines which basically makes this > impossible to achieve. When the NodeFilter accept_node() method returns > FILTER_REJECT the while(1) ends up in an infinite loop. > > The problem is that the iterator function works with the node stored in > $self->{CURRENT} (and also refers to $self->{INDEX}). When a value of > FILTER_REJECT is returned neither the current node or the index are > updated before the next call to the iterator. This results in the > iterator code forever returning the same "next" node. >
Hi! Can you write a t/*.t test case for that? See https://github.com/shlomif/XML-LibXML-Iterator .