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. |
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/>
Message body is not shown because sender requested not to inline it.