Skip Menu |

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

Report information
The Basics
Id: 16806
Status: resolved
Priority: 0/
Queue: POE-Filter-XML

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

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



Subject: to_str() does the wrong thing with CDATA of "0"
The to_str() method appears to contain a bug which causes it to wrongly render elements whose data is the string "0". Line 366 of POE::Filter::XML::Node version 0.27 contains the following conditional: if ($self->[+tagdata] or keys %{$self->[+kids]}) This treats an element as empty if it is holding "0" in [+tagdata], since "0" is false in Perl boolean context. As a result, that element will be output as completely empty. In my copy of the module I have changed it like this. I'm not sure if this is the best way to accomplish it. if ( ($self->[+tagdata] || $self->[+tagdata] eq "0") or keys %{$self->[+kids]})
Alright. The best way to deal with that is to test the length of the data, rather than have two tests. I am working on a new release of POE::Component::Jabber. I hope to have a release this weekend. I will adjust to_str(). Thanks for pointing this out. [guest - Fri Dec 30 01:18:11 2005]: Show quoted text
> The to_str() method appears to contain a bug which causes it to > wrongly render elements whose data is the string "0". > > Line 366 of POE::Filter::XML::Node version 0.27 contains the following > conditional: > > if ($self->[+tagdata] or keys %{$self->[+kids]}) > > This treats an element as empty if it is holding "0" in [+tagdata], > since "0" is false in Perl boolean context. As a result, that element > will be output as completely empty. > > In my copy of the module I have changed it like this. I'm not sure if > this is the best way to accomplish it. > > if ( ($self->[+tagdata] || $self->[+tagdata] eq "0") or keys %{$self-
> >[+kids]})
On Fri Dec 30 01:47:42 2005, NPEREZ wrote: Show quoted text
> > Alright. The best way to deal with that is to test the length of the > data, rather than have two tests. I am working on a new release of > POE::Component::Jabber. I hope to have a release this weekend. I will > adjust to_str().
I've attached the patch that we've been using. Is it going to be much longer till the new release? We're at the point of having to distribute a patched copy of PFX with our project until there is and I'd rather not do that at all...
--- /Library/Perl/5.8.6/POE/Filter/XML/Node.pm~ 2006-01-22 22:56:05.000000000 -0500 +++ /Library/Perl/5.8.6/POE/Filter/XML/Node.pm 2006-01-22 22:56:05.000000000 -0500 @@ -362,7 +362,7 @@ $str .= ' ' . $attr . "='" . $self->[+attrs]->{$attr} . "'"; } - if ($self->[+tagdata] or keys %{$self->[+kids]}) + if (length $self->[+tagdata] or keys %{$self->[+kids]}) { $str .= '>' . $self->[+tagdata];
Subject: Re: [rt.cpan.org #16806] to_str() does the wrong thing with CDATA of "0"
Date: Mon, 23 Jan 2006 23:03:01 -0600
To: bug-POE-Filter-XML [...] rt.cpan.org
From: Nicholas Perez <nicholasrperez [...] gmail.com>
That looks good but I would be explicit and wrap the argument for length in parentheses (in my repository it is like that, actually). Apologies for not getting this done sooner, but when ten and twelve hour work days designing circuit boards have nothing to do with programming, it is difficult to come home in the evenings and have the drive to fix and release. Where I last left off in the process of packaging for release was dealing with MakeMaker. For whatever reason it was refusing to install deps from CPAN from a "make install." Something is gobbling up the deps when outside of CPAN::Shell. I was thinking of switching to Module::Install or something in that similar vein. I'll try to get things done this week, but I can't make any promises. Life just gets in the way, you know? On 1/22/06, via RT <bug-POE-Filter-XML@rt.cpan.org> wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=16806 > > > On Fri Dec 30 01:47:42 2005, NPEREZ wrote:
> > > > Alright. The best way to deal with that is to test the length of the > > data, rather than have two tests. I am working on a new release of > > POE::Component::Jabber. I hope to have a release this weekend. I will > > adjust to_str().
> > I've attached the patch that we've been using. Is it going to be much longer till the new release? > > We're at the point of having to distribute a patched copy of PFX with our project until there is > and I'd rather not do that at all... > > > >
Hi there! Okay, I have finally got everything all packaged up and ready to go. I swapped to Module::Build to do installation for everything and it seems to work just fine. I haven't tested it under cpan yet because it will take a while for the new upload to propogate out to the mirrors. Let me know if you have any more problems. Also note that I updated the dependancies to the latest POE (which removed POE::Preprocessor-- it got shunted off into its own project: Filter::Template), and other assorted modules. Thre may be additional bugs lurking due to the amount of potential bitrot that my have occured over the past few months I haven't been keeping in lock step with POE or other deps (like XML::SAX). Sorry it took so long for me to incorporate this. On Tue Jan 24 00:03:44 2006, nicholasrperez@gmail.com wrote: Show quoted text
> That looks good but I would be explicit and wrap the argument for > length in parentheses (in my repository it is like that, actually). > Apologies for not getting this done sooner, but when ten and twelve > hour work days designing circuit boards have nothing to do with > programming, it is difficult to come home in the evenings and have the > drive to fix and release. Where I last left off in the process of > packaging for release was dealing with MakeMaker. For whatever reason > it was refusing to install deps from CPAN from a "make install." > Something is gobbling up the deps when outside of CPAN::Shell. I was > thinking of switching to Module::Install or something in that similar > vein. I'll try to get things done this week, but I can't make any > promises. Life just gets in the way, you know? > > On 1/22/06, via RT <bug-POE-Filter-XML@rt.cpan.org> wrote:
> > > > <URL: http://rt.cpan.org/Ticket/Display.html?id=16806 > > > > > On Fri Dec 30 01:47:42 2005, NPEREZ wrote:
> > > > > > Alright. The best way to deal with that is to test the length of
> the
> > > data, rather than have two tests. I am working on a new release of > > > POE::Component::Jabber. I hope to have a release this weekend. I
> will
> > > adjust to_str().
> > > > I've attached the patch that we've been using. Is it going to be
> much longer till the new release?
> > > > We're at the point of having to distribute a patched copy of PFX
> with our project until there is
> > and I'd rather not do that at all... > > > > > > > >