Skip Menu |

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

Report information
The Basics
Id: 73160
Status: resolved
Priority: 0/
Queue: XML-Feed

People
Owner: DAVECROSS [...] cpan.org
Requestors: szabgab [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.47



Subject: spaces in tags are not discarded
Date: Sat, 10 Dec 2011 17:17:14 +0200
To: bug-XML-Feed [...] rt.cpan.org
From: Gabor Szabo <szabgab [...] gmail.com>
When there are extra spaces in the feed (e.g. in <link>, <dc:date>) <item rdf:about="http://www.cantrell.org.uk/david/journal/id/olympic-costs-yet-again"> <title> Oh look, more Olympic financial incompetence </title> <link> http://www.cantrell.org.uk/david/journal/id/olympic-costs-yet-again</link> <description></description> <dc:date> 2011-12-06T22:36:07Z </dc:date> <dc:creator> </dc:creator> taken from http://www.cantrell.org.uk/david/journal/format/rss the spaces are not discarded. use strict; use warnings; use XML::Feed; my $feed = XML::Feed->parse(URI->new('http://www.cantrell.org.uk/david/journal/format/rss')) or die XML::Feed->errstr; for my $entry ($feed->entries) { printf ("'%s'\n", $entry->link); print $entry->issued; } the link user can easily fix but "issued" is undef Using XML::Feed 0.46
Subject: Re: [rt.cpan.org #73160] spaces in tags are not discarded
Date: Sat, 10 Dec 2011 12:46:16 -0800
To: bug-XML-Feed [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
Sounds like XML::LibXML's default behavior that keeps whitespaces, which can be turned off via keep_blanks(0): http://search.cpan.org/~phish/XML-LibXML-1.54/LibXML.pm#keep_blanks On Sat, Dec 10, 2011 at 7:17 AM, Gabor Szabo via RT <bug-XML-Feed@rt.cpan.org> wrote: Show quoted text
> Sat Dec 10 10:17:23 2011: Request 73160 was acted upon. > Transaction: Ticket created by szabgab@gmail.com >       Queue: XML-Feed >     Subject: spaces in tags are not discarded >   Broken in: (no value) >    Severity: (no value) >       Owner: Nobody >  Requestors: szabgab@gmail.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=73160 > > > > When there are extra spaces in the feed (e.g. in <link>, <dc:date>) > >  <item rdf:about="http://www.cantrell.org.uk/david/journal/id/olympic-costs-yet-again"> >    <title> Oh look, more Olympic financial incompetence </title> >    <link> http://www.cantrell.org.uk/david/journal/id/olympic-costs-yet-again</link> >    <description></description> >    <dc:date> 2011-12-06T22:36:07Z </dc:date> >    <dc:creator>  </dc:creator> > > taken from http://www.cantrell.org.uk/david/journal/format/rss > > the spaces are not discarded. > > > use strict; > use warnings; > > use XML::Feed; > my $feed = XML::Feed->parse(URI->new('http://www.cantrell.org.uk/david/journal/format/rss')) >    or die XML::Feed->errstr; > > for my $entry ($feed->entries) { >        printf ("'%s'\n", $entry->link); >        print $entry->issued; > } > > the link user can easily fix but "issued" is undef > > Using XML::Feed 0.46 >
-- Tatsuhiko Miyagawa
RT-Send-CC: miyagawa [...] gmail.com
But XML::Feed uses XML::RSS to parse RSS feeds. And XML::RSS uses XML::Parser, not XML::LibXML. It feels like this is something that XML::RSS should be dealing with. In my opinion, XML::Feed shouldn't be fixing the behaviour of tools that XML::RSS uses. But in the meantime I can probably trim all datetime strings before XML::Feed tries to parse them.
RT-Send-CC: miyagawa [...] gmail.com
I've put a potential fix for this on github https://github.com/davorg/xml-feed Please take a look and let me know what you think. Dave...
Subject: Re: [rt.cpan.org #73160] spaces in tags are not discarded
Date: Sun, 11 Dec 2011 08:53:51 -0800
To: bug-XML-Feed [...] rt.cpan.org
From: Tatsuhiko Miyagawa <miyagawa [...] gmail.com>
On Sun, Dec 11, 2011 at 2:44 AM, Dave Cross via RT <bug-XML-Feed@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=73160 > > > But XML::Feed uses XML::RSS to parse RSS feeds. And XML::RSS uses > XML::Parser, not XML::LibXML. > > It feels like this is something that XML::RSS should be dealing with. In > my opinion, XML::Feed shouldn't be fixing the behaviour of tools that > XML::RSS uses.
I agree. -- Tatsuhiko Miyagawa
Fixed in 0.47 (now on CPAN).