Skip Menu |
 

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

Report information
The Basics
Id: 4495
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: XML-RSS

People
Owner: SHLOMIF [...] cpan.org
Requestors: spoon [...] cpan.org
Cc:
AdminCc:

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



Date: Thu, 27 Nov 2003 00:00:25 +1100
From: Iain Truskett <spoon [...] cpan.org>
To: bug-xml-rss [...] rt.cpan.org
Subject: Patch to allow arrayrefs, thus multiple values.
Download (untitled) / with headers
text/plain 1.3k
Heyo, In order to let the trackback module work properly [1], one must be able to have multiple instances of the trackback:about element. [1] http://madskills.com/public/xml/rss/module/trackback/ e.g. tb => [ ping => CGI::Kwiki::Plugin::TrackBack::tb_id( $self, $page_id ), ( @$pings ? ( map { ("about" => $_->{ping}) } @$pings ) : () ) ] As you know, with a hash ref this would be impossible. Arrayrefs works well though. Thus, the attached patch which, at the expense of a bit more initial logic, lets one use either arrays or hashes. No worries about backwards compatibility as previously XML::RSS would've died when trying to dereference the arrayref as a hashref. I was curious about how sometimes it received something that wasn't a reference (hence the empty condition). I'm not sure if that's a bug or intended. You may want to look into it. Or not =) See http://iain.truskett.id.au/feed.rss for an example of it in use (the PythonArticles item). On another note: the TrackBack module reference uses this as an alternative syntax (preferred for RSS 1.0 based output): <trackback:ping rdf:resource="http://bar.com/tb.cgi?tb_id=rssplustrackback"/> Damned if I know how to generate that, though. cheers, -- Iain. <http://eh.org/~koschei/>
Download xmlrss-arrays.patch
text/x-diff 2.6k

Message body is not shown because sender requested not to inline it.

From: SPOON
Naturally that should be saying: for my $i ( 0..($#$j/2-1) ) Yay for off-by-ones.
Download (untitled) / with headers
text/plain 262b
This was fixed in the trunk. SPOON has passed away unfortunately, but I hope other people will find it useful. Note that the semantics of this patch are different: it's an array of {'el' => 'val'} => hash-refs instead of an array of interleaved keys and values.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.