You are here:  » Affiliate XML Feed Categories Into Mysql


Affiliate XML Feed Categories Into Mysql

Submitted by sjhaines on Fri, 2010-10-01 12:52 in

Hi,

I have a affiliate product feed and need to insert the categories into Mysql, the structure of the XML is defined below:

Top Level Category

Sub Categories

Sub Sub Categories (Some sub cats have sub sub cats under them, some dont)

The problem I have is I can insert the main cats into the db and the subcats, but I cant locate the sub sub cats, becuase some sub cats have subs but others dont.

Also all the cats need to be linked so MainCat has ID then SubCat has MainCat ID and Sub Sub Cats have Subcat and MainCat.

Sorry if this doesnt make sense but I am really stuck with it. I have scaled down the XML file below, it contains the Top level Cat and 3 Sub Cats with the last containing Sub Sub Cats.

<QueryResponse>
<TaxonomyResponse>
<Taxonomy>
<Categories>
<Category id="1">
<name>Home</name>
<Children>
<Category id="12000000">
<name>Sports Equipment & Outdoor Gear</name>
<url>
http://www.bizrate.com/sportsequipment_outdoorgear/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
<Children>
<Category id="12180000">
<name>Binoculars & Telescopes</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/binoculars_telescopes/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
<Category id="12000100">
<name>Bowling Equipment</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/bowlingequipment/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
</Children>
</Category>
<Category id="52">
<name>Music</name>
<url>
http://www.bizrate.com/music/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
<Children>
<Category id="5201">
<name>Blues Music</name>
<minimumBid>15</minimumBid>
<url>
http://www.bizrate.com/bluesmusic/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
<Category id="5202">
<name>Children's Music</name>
<minimumBid>15</minimumBid>
<url>
http://www.bizrate.com/childrensmusic/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
</Children>
</Category>
<Category id="24">
<name>Office Supplies</name>
<url>
http://www.bizrate.com/officesupplies/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
<Children>
<Category id="10">
<name>Mailing & Shipping Supplies</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/mailing_shippingsupplies/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
<Children>
<Category id="1003">
<name>Miscellaneous Mailing & Shipping Supplies</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/miscellaneousmailing_shippingsupplies/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
<Category id="12">
<name>Calendars, Organizers & Planners</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/calendarsorganizers_planners/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
<Children>
<Category id="1201">
<name>Calendars</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/calendars/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
<Category id="1202">
<name>Organizers & Planners</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/organizers_planners/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
<Category id="1203">
<name>Miscellaneous Calendars, Organizers & Planners</name>
<minimumBid>20</minimumBid>
<url>
http://www.bizrate.com/miscellaneouscalendarsorganizers_planners/index__rf--af1__af_assettype_id--10__af_creative_id--6__af_id--21784__af_placement_id--1.html
</url>
</Category>
</Children>
</Category>
</Children>
</Category>
</Children>
</Category>
</Children>
</Category>
</Categories>
</Taxonomy>
</TaxonomyResponse>
</QueryResponse>

Submitted by support on Fri, 2010-10-01 13:25

Hi there,

I've just picked up your Get It Coded! request which looks to be the specific data relating to this so I'll proceed with that in the light of your comments above and get back to in response to that ASAP...

Cheers,
David.
--
MagicParser.com