You are here: xml has multiple tags with same name for different values problem « All PHP « IT news, forums, messages
xml has multiple tags with same name for different values problem

Posted by google on 10/13/12 11:29

I am parsing xml responses from Amazon Web Service queries. The problem
is, the doc contains elements like

<lowestnewprice>
<formattedprice>4.99</formattedprice>
<amount>499</amount>
</lowestnewprice>
<lowestusedprice>
<formattedprice>2.99</formattedprice>
<amount>299</amount>
</lowestusedprice>

For now, I only want the lowest used price, but my parser is looking
for <amount>, and is returning me the first one. I considered putting
each instance into an array, but I cannot be sure that all the xml
trees for each product contain the same amount of elements. If a
product is not available new, maybe the first instance would be the
lowestusedprice, not the lowestnewprice as I normal.

How can I approach this, please..?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация