ceddy Posted June 8, 2007 Share Posted June 8, 2007 Im trying to modify an XML Feed, created by Yahoo Stores (why I cannot just modify the xml generator code) to exclude some content.. here is an example of a product on my xml feed <Product Id="10niedwaoil4"> <Code>1001flav</Code> <Description>1001 Nights Edible Warming Massage Oil 4oz.</Description> <Url>http://store.lovepotions.com/10niedwaoil4.html</Url> <Thumb><img border=0 width=70 height=53 src=http://us.st11.yimg.com/us.st.yimg.com/I/lovepotionsgifts_1951_352361></Thumb> <Picture><img border=0 width=500 height=381 src=http://us.st11.yimg.com/us.st.yimg.com/I/lovepotionsgifts_1951_356335></Picture> <Orderable>YES</Orderable> <Taxable>YES</Taxable> <Pricing> <BasePrice>12.75</BasePrice> <LocalizedBasePrice>12.75</LocalizedBasePrice> <SalePrice>9.99</SalePrice> <LocalizedSalePrice>9.99</LocalizedSalePrice> </Pricing> <Path> <ProductRef Id="edwamaoi" Url="http://store.lovepotions.com/edwamaoi.html">Edible Flavored Warming Massage Oils & Lotions</ProductRef> </Path> <Availability>Usually ships the next business day.</Availability> <Caption>Delightfully edible, this precious oil in 4 fl. oz bottles warms to the touch and comes in 3 sinfully sweet flavors. Beautifully packaged and Labled you'll have no problem leaving these bottles out on display! <li> Passion Fruit & Ginger <li> Cherry Almond <li> Strawberry Spice</Caption> <OptionLists> <OptionList name="Flavor"> <OptionValue>Passion Fruit & Ginger</OptionValue> <OptionValue>Cherry Almond</OptionValue> <OptionValue>Strawberry Spice</OptionValue> </OptionList> </OptionLists> Now I need to convert this to a CSV file, which Ive done. However, you can see under the products image <Picture><img border=0 width=500 height=381 src=http://mydomain.com/pics/img1.jpg</Picture> it doesnt only include the image location, it also includes the html source to display the image on a given html file. Which is bad, googlebase, bizrate etc of course do not need or want this. How can I go about creating a php file that will open a file, look for an inline <Picture> and remove the text between characters < and = and recreate the file so the new file's image location would be <Picture>http://mydomain.com/pics/img1.jpg</Picture> Quote Link to comment https://forums.phpfreaks.com/topic/54686-modifying-xml-feed-help-pls/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.