Hi all, A customer of mine has a website selling machines. Now he wants to advertise his machines on another (generic) website. This site uses (sub)categories in which products can be listed and then a link is given to a found product, which may be from any of the companies supporting the generic site.
The generic site wants from me an XML page (say: www.customer.nl/export.php), that they can download daily to update their site. So far so good, because the XML is easy to format. Things complicate a bit more as my customer has to provide the values of the (sub)category keys with each article, in order for them to be processed correctly by the generic site. Thus I need to implant in the site of my customer two tables, for category and ubcategory, so on my site I can provide in the CMS two dropdowns where the customer can select correctly the values for the foreign keys as used in this other site. Having chosen those values, the XML I will be exporting will be complete. Now I need to build these tables. The generic site also has a script, which can be called in cron, to give me the index (primary key) and value pairs I need to consruct my dropdowns. My problem is: they don't export these values as .csv format (which would be muuuuuch easier, just read the response line by line, 'explode' the line, and use the first value as primary key and the second as description). Instead, they publish an XML file, in which values are given like <row> <id>68</id> <cat_name>Aanvoer & aandrijftechniek</cat_name> </row> anybody who has a 'quick 'n dirty' hack for how to extract rapidly for each row the values for 'id' and 'cat_name'? Any parsing that goes beyond 'fgetcsv' and then 'explode' always seemed like a huge waste of time to me when exporting csv is so much quicker and simpler. But I guess even my time to start working on XML has come :-( Marc
