Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-24 04:04:45

sthmtc
Member
From: CGN, GER
Registered: 2005-01-17
Posts: 586
Website

incorporating xml data

ok first the background of this question. i’m taking part in an affiliate program, i choose some products from a specific webshop and display them in my page context. as default they’re offering some iframe widget which i can’t use as it doesn’t integrate nicely in my site and also i’m not sure if it produces non-valid code. so first i thought about some handcoding: passing the products id in a custom field and letting an article form add our affiliate ID and build the links etc. the problem with this is of course that if the webshop changes the price for an item i’d have to change that by hand. not so good.

so i talked to them about alternatives and they offered me XML. great, i thought, that must be easy to incorporate. some tutorials later i have a bit of an idea but i really don’t know what would be the best/right way to do it. i’d love to do it the most elegant way so i’m asking you for your opinion.

what i get from them is an URL (which i can construct from the product ID and our affiliate ID) leading to an XML file that looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE record SYSTEM "record.dtd">
<?xml-stylesheet type="text/css" href="XMLrecord.css"?>
<record>
<artist>some artist</artist>
<recordtitle>some record</recordtitle>
<coverTnImageFile>http://www.link.to/image/cover.jpg</coverTnImageFile>
<price>13.95</price>
<format>CD</format>
<url>http://www.link.to/item_*item ID*_*affiliate ID*.html</url>
<currency>EUR</currency>
</record>

any input and suggestions are highly appreciated!

Offline

Board footer

Powered by FluxBB