in reply to XML::RSS, Google Base, and multiple entries

My guess would be that, since you are using unknown namespace 'g', XML::RSS does not know how to process its elements. So it does next best thing -- converts them to strings and tries to build hierachy based on the provided datastructure.

So when you are supplying array reference as in:

... -> label => ['Foo', 'Bar'] ...

In your example it converts array ref to string, and thus "ARRAY(0x#####)" thingy.

As I read documentation from XML::RSS module, it says that the only supported namespaces out-of-the-box are: Dublin Core (http://purl.org/rss/1.0/modules/dc/), Syndication (http://purl.org/rss/1.0/modules/syndication/), and Taxonomy (http://purl.org/rss/1.0/modules/taxonomy/)

By reading further, we see that

XML::RSS also has support for "non-standard" RSS 1.0 modularization at the channel, image, item, and textinput levels. Parsing an RSS document grabs any elements of other namespaces which might appear. XML::RSS also allows the inclusion of arbitrary namespaces and associated elements when building RSS documents. For example, to add elements of a made-up "My" module, first declare the namespace by associating a prefix with a URI:
$rss->add_module(prefix=>'my', uri=>'http://purl.org/my/rss/module/');
Then proceed as usual:
$rss->add_item (title=>$title, link=>$link, my=>{ rating=>$rating });
Check module's POD for more information.

Keep in mind that the sited documentation referes to XML::RSS version 1.10.

Hope this helps.

BR

Replies are listed 'Best First'.
Re^2: XML::RSS, Google Base, and multiple entries
by minter (Novice) on Oct 09, 2006 at 17:44 UTC
    Thanks for the info. I've got the nonstandard module stuff working fine, it's just that Google Base seems to want items with multiple values as a series of identical elements:
    <g:label>Label 1</g:label> <g:label>Label 2</g:label>
    But XML:RSS doesn't seem to support outputting that type of XML, at least not that I can tell. For nonstandard namespace elements with a single value, it's working fine.