Forum Moderators: coopster & phranque

Message Too Old, No Replies

Parsing RSS namespaces

with xml::rss...

         

seks

5:58 am on Mar 31, 2008 (gmt 0)

10+ Year Member



Hi, I have written a script with xml::rss to deal with ebay's feeds.

One problem I've run into that I can't seem to figure out:

Some values that I need (category, paypal support) are coded like this:

rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents"

I can't seem to find XML::RSS support for dealing with reading this. It's not even in standard RSS format where xmlns is a url.

Things like

 @{$rss->{'items'}->{'rx:ItemCharacteristic xmlns:rx="urn:ebay:apis:eBLBaseComponents"'}'
don't work. Sorry I am not at all experienced with RSS or evil XML! How do I parse these short of downloading the text and using regexp?

Thanks for your help

phranque

9:56 am on Mar 31, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



welcome to WebmasterWorld [webmasterworld.com]!

just a couple of guesses here, but you might be able to access it with something like:
$rss->{items}->[0]->{rx}->{ItemCharacteristic};

and you might first need to do something with the add_module method to handle nonstandard nodules.

you might also consider debugging with something like Data::Dumper [search.cpan.org] when you are lost with a complex or recursive data structure.
this post from the WebmasterWorld perl Library has a simple usage example:
[webmasterworld.com...]