摘自Lyrics Wikia REST api XML响应http://api.wikia.com/wiki/LyricWiki_API/REST,我该如何解析?我无法找到使用这些节点的其他人的任何示例。
http://lyrics.wikia.com/api.php?func=getArtist&artist=Linkin_Park&fmt=xml
<getArtistResponse>
<artist>Linkin Park</artist>
<albums>
<album>Xero</album>
<year>1997</year>
<amazonLink>
http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=wikia-20&camp=1789&creative=9325&path=external-search%3Fsearch-type=ss%26index=music%26keyword=Linkin%20Park%20Xero
</amazonLink>
<songs>
<item>Rhinestone</item>
<item>Reading My Eyes</item>
<item>Fuse</item>
<item>Stick N' Move</item>
</songs>
<album>Hybrid Theory</album>
<year>1999</year>
<amazonLink>
http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=wikia-20&camp=1789&creative=9325&path=external-search%3Fsearch-type=ss%26index=music%26keyword=Linkin%20Park%20Hybrid%20Theory
</amazonLink>
<songs>
<item>Carousel</item>
<item>Technique</item>
<item>Step Up</item>
<item>And One</item>
<item>High Voltage (EP Version)</item>
<item>Part Of Me</item>
<item>High Voltage</item>
<item>Esaul (Underground EP)</item>
</songs>
<album>Hybrid Theory</album>
<year>2000</year>
<amazonLink>
http://www.amazon.com/exec/obidos/redirect?link_code=ur2&tag=wikia-20&camp=1789&creative=9325&path=external-search%3Fsearch-type=ss%26index=music%26keyword=Linkin%20Park%20Hybrid%20Theory
</amazonLink>
<songs>
<item>Papercut</item>
<item>One Step Closer</item>
<item>With You</item>
<item>Points Of Authority</item>
<item>Crawling</item>
<item>Runaway</item>
<item>By Myself</item>
<item>In The End</item>
<item>A Place For My Head</item>
<item>Forgotten</item>
<item>Cure For The Itch</item>
<item>Pushing Me Away</item>
<item>My December</item>
<item>High Voltage</item>
<item>Papercut</item>
<item>Papercut</item>
<item>Points Of Authority</item>
<item>A Place For My Head</item>
</songs>
我希望这些内容看起来像以下链接到每个歌曲节点:
Xero 1997:水钻读我的眼睛保险丝坚持N&#39;移动 混合理论1999:旋转木马技术升级等等。
我已经能够通过`
获取歌曲&gt;项目foreach ($xml->albums->songs as $entry){
$item0 = $entry->item[0];
$item1 = $entry->item[1];
$item2 = $entry->item[2];
$item3 = $entry->item[3];
$item4 = $entry->item[4];
etc
但是我没有成功地抓住每张专辑,并且超过了第一张专辑。
感谢您的帮助。 :)