You are here:  » "&" symbol in single product XML feed.

Support Forum



"&" symbol in single product XML feed.

Submitted by steve on Sat, 2008-10-18 19:06 in

Hey David,

I have created my own XML file for a merchant from Webgains that does not have their own feed.

<?xml version="1.0" encoding="utf-8"?>
<products>
    <product>
        <ProductName>2minutedraw</ProductName>
        <ProductDescription>2minutedraw.com is a fun new survey site. Win amazing prizes every month just by filling in the simple 2 minute survey! No hassle, no fuss, just 2 minutes of your time and you could be well on your way to having an extra £2000 in your pocket!</ProductDescription>
        <ImageURL>http://www.XXX.com/logos/2minutedraw</ImageURL>
        <BuyURL>http://track.webgains.com/click.html?wgcampaignid=XXX&wgprogramid=XXX</BuyURL>
        <Price>0</Price>
    </product>
</products>

When I try and register this feed the sample data does not show so I can't register. With some trial and error I managed to pin point the problem. It is with the "&" symbol in the BuyURL. When I remove this the sample data shows and I can import the feed.

The strange thing is I am using webgains own xml feeds from other merchants. These feeds have the same format url with the "&" symbol. The only thing I can think of is the encoding, which is utf-8 in my feed above, but this is the same encoding as the webgains feeds aswell which work fine. Any idea what the problem is?

Thanks, Steven

Submitted by support on Sun, 2008-10-19 13:43

Hi Steven,

Because the "&" symbol has a special meaning within XML; it must either be entity encoded itself as "&amp;", or the entire field delimited within CDATA tags, for example:

<BuyURL><![CDATA[http://track.webgains.com/click.html?wgcampaignid=XXX&wgprogramid=XXX]]></BuyURL>

That should sort it!

Cheers,
David.