At 06:03 AM 5/9/2006, Andy Rolls-Drew wrote:
All, I am fairly new to parsing XML using PHP and wonder if anyone has a solution to the following. I have a file eg:- <<?xml version="1.0" ?> <STOREITEMS> <CREATED value="Wed Mar 15 8:07:27 GMT 2006"> <CATEGORY id='67' name='Herbal Pharmacy'> <PRODUCT ITEM='603'> <NAME></NAME> <MODEL></MODEL> <PRICE></PRICE> <PRODUCT ITEM='608'> <NAME></NAME> <MODEL></MODEL> <PRICE></PRICE> <CATEGORY id='69' name='Extras'> <PRODUCT ITEM='1123'> <NAME></NAME> <MODEL></MODEL> <PRICE></PRICE> <PRODUCT ITEM='2034'> <NAME></NAME> <MODEL></MODEL> <PRICE></PRICE> And so on. I have managed to parse a little of it using Magic Parser but I still cant manage to split the products and categories correctly. If there weren't multiple products for each category I think I would have it. Any help would be a start. Thanks in advance Andy
I don't know much about XML, but <CATEGORY> is not closed in you example, neither is PRODUCT ITEM ... are you sure the XML is well-formed?
And now we don't want a sig like yours. Could you please shorten it? Regards - Miles Thompson -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.1.392 / Virus Database: 268.5.5/334 - Release Date: 5/8/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php