1
我玩过json,但是我只是从xml开始,我如何加载这个url然后解析gamertag?如何使用xml api
的URL是这样的:
http://xboxapi.xxxxxxx.co.uk/profile?apikey=$key&gamertag=$gamertag
,并返回
<xbox status="success" version="0.0.9">
<gamertag>l RaH l</gamertag>
<motto>I Win With Randoms</motto>
<avatar>
<full>http://avatar.xboxlive.com/avatar/l rah l/avatar-body.png</full>
<small>http://avatar.xboxlive.com/avatar/l rah l/avatarpic-s.png</small>
<large>http://avatar.xboxlive.com/avatar/l rah l/avatarpic-l.png</large>
</avatar>
<gamerscore>12550</gamerscore>
<biography><![CDATA[Bio]]></biography>
<recentactivity>
<game>
<title>Xbox.com</title>
<artwork>/Content/Images/Presence/xboxcom.jpg</artwork>
<presence>Last played less than a minute ago</presence>
</game>
<game id="1297287259">
<title>Halo: Reach</title>
<artwork>http://tiles.xbox.com/consoleAssets/4D53085B/en-US/largeboxart.jpg</artwork>
<gamerscore>
<current>1205</current>
<outof>1400</outof>
</gamerscore>
</game>
<game id="1297287142">
<title>Halo 3</title>
<artwork>http://tiles.xbox.com/consoleAssets/4D5307E6/en-US/largeboxart.jpg</artwork>
<gamerscore>
<current>1750</current>
<outof>1750</outof>
</gamerscore>
</game>
</recentactivity>
<freshness>new</freshness>
</xbox>
goooooooogle .... ** AHHH其谷歌的鬼!** – Neal 2011-03-30 22:04:11
^像幽灵尼尔有效的XML声明说... [把你的选择](http://nl2.php.net/manual/en/refs.xml.php)(简单的xml或DOM想起来)。 – Wrikken 2011-03-30 22:07:49
请使用搜索功能。有很多例子。 – Gordon 2011-03-30 22:11:09