我贴出xml文件的一部分代码,显示我想获得的内容
<media:content medium="image" url="http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/111010-romney-health-4p.thumb.jpg">
<media:credit role="provider">Getty Images file</media:credit>
<media:copyright>2010 Getty Images</media:copyright>
<media:text><![CDATA[<p><a href="http://www.msnbc.msn.com/id/44854320/ns/politics-decision_2012/"><img align="left" border="0" src="http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/111010-romney-health-4p.thumb.jpg" alt="Mitt Romney speaks at the National Press Club March 5, 2010 in Washington, D.C." style="margin:0 5px 5px 0" /></a></p><br clear="all" />]]></media:text>
</media:content>
现在我想检索 URL tab,如何检索呢?
用的下面的代码:
if(parser.getName().equalsIgnoreCase("media:content"))
{
Log.d("media count-->",parser.getAttributeCount()+"");
}
然后给出的是-1.
请求大家给点意见,如何得到图像的url?