I'm working on a Perl program to bulk-upload information to Google Base. My first attempt is using XML::RSS, since RSS and Atom are supported upload formats. For attributes that can have multiple entries, it seems that the Google Base format wants something like this:
<g:label>Hi-Tech</g:label> <g:label>Business development</g:label> <g:label>Personnel</g:label> <g:label>Silicon Valley</g:label>
However, I can't see how to get XML::RSS to do that. I've tried passing in an array reference, but that just outputs ARRAY(0x####):
$rss->add_item( title => $row->{description}, description => $row->{description}, link => "$urlbase/searchnew.php/$row->{id}", g => { image_link => "$urlbase/$row->{picture}", price => $baseprice, price_type => 'negotiable', id => $row->{id}, label => ['Foo', 'Bar'] } );
outputs
<g:label>ARRAY(0xb10bd0)</g:label> <g:id>4374</g:id> <g:price>$170.00</g:price> <g:price_type>negotiable</g:price_type>
Passing in a list just gives errors about an uneven number of arguments to the hash. And multiple hash keys with the same name, of course, just provides the last one given. So is this sort of thing possible with XML::RSS, or do I need to move to a more specialized XML generator?

In reply to XML::RSS, Google Base, and multiple entries by minter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.