Hi David,
I have a problem with some feeds, especially with those that have & in the buy url (as shown below). I am unable to Register them, because it shows me just "XML|SHOP/" in the input field, but correct would be "XML|SHOP/SHOPITEM/" and even if I write it manually then no sample data on step 2 page is shown.
This is not OK:
<SHOP><SHOPITEM>
..
<URL>http://www.merchant_domain.cz/product/?prov=795&utm_medium=srovnavac</URL>
..
</SHOPITEM><SHOP>
This works absolutely fine: (but I need to open it in an editor and to manually edit it which is not a good idea while it should be imported every day)
<SHOP><SHOPITEM>
..
<URL>http://www.merchant_domain.cz/product/?prov=795&utm_medium=srovnavac</URL>
..
</SHOPITEM><SHOP>
So the problem is definitely in the & symbol. Is there any way to change & to & automatically when registering?
Hi David,
I have worked it out. I rewrote the script that I use for cron-based copying XML feeds from partners to my server and added str_replace("&", "&", $feed) there, so PT works with a valid XML file then. And it works fine.
Quite an easy solution, but I was not able to solve it out at 2am:-)
Hello David,
Unfortunately, & on its own (without being enclosed within CDATA tags) is not valid XML; and is impossible to parse legitimately because the parser must look for the corresponding entity characters. In this situation, the best way forward would be to contact the merchant and ask if they are aware of the issue and would be able to rectify it...
In theory it is possible to look at work-arounds that involved patching the parser to check for this filename and then perform a string replacement when reading the XML; so if you're not able to get the feed corrected let me know and I'll work through this with you; but it's far from ideal so it's always best to bring these issues to the attention of the company generating the feed as it will be in their benefit ultimately - as many affiliates will just give-up trying to use their feed and end up not promoting them!
Cheers,
David.