如何从Android中的HTMl代码获取Tag值?
我正在通过 SAX 解析器进行 RSS 解析,并且我得到了这种格式的描述:
<description><![CDATA[<div><b>Start Time:</b> 12/19/2010 6:30 PM</div>
<div><b>End Time:</b> 12/19/2010 10:00 PM</div>
<div><b>Description:</b> Break Guinness World Records of arda</div>
<div><b>Type of Event:</b> <a onclick="OpenPopUpPage('http://www.example.com/_layouts/listform.aspx?PageType=4&ListId={5368B20F-2E1F-4984-9308-3E46442B2336}&ID=79&RootFolder=*', RefreshPage); return false;" href="http://www.example.com/_layouts/listform.aspx?PageType=4&ListId={5368B20F-2E1F-4984-9308-3E46442B2336}&ID=79&RootFolder=*">Aspire closed stadium</a></div>
<div><b>Localization Data:</b> <data><item field="Title" lang="ar-SA"> Break record </item><item field="Description" lang="ar-SA">&lt;P align=right&gt;Break record &amp;nbsp; 9/12/2010 Break record " National " Men Poetry Activities . &lt;/P&gt;</item></data></div>
<div><b>LocationInInteractiveMap:</b> Don't Show</div>
<div><b>Latitude:</b> 25.266024</div>
<div><b>Longitude:</b> 51.443814</div>
<div><b>EventLogo:</b> <img alt="" src="/SiteCollectionImages/Event%20Images/Default.png" style="BORDER: 0px solid; "></div>
]]></description>
那么我如何从这个 html 代码中获取标签值呢?
I am doing RSS parsing by SAX parser and i am getting Description in this format :
<description><![CDATA[<div><b>Start Time:</b> 12/19/2010 6:30 PM</div>
<div><b>End Time:</b> 12/19/2010 10:00 PM</div>
<div><b>Description:</b> Break Guinness World Records of arda</div>
<div><b>Type of Event:</b> <a onclick="OpenPopUpPage('http://www.example.com/_layouts/listform.aspx?PageType=4&ListId={5368B20F-2E1F-4984-9308-3E46442B2336}&ID=79&RootFolder=*', RefreshPage); return false;" href="http://www.example.com/_layouts/listform.aspx?PageType=4&ListId={5368B20F-2E1F-4984-9308-3E46442B2336}&ID=79&RootFolder=*">Aspire closed stadium</a></div>
<div><b>Localization Data:</b> <data><item field="Title" lang="ar-SA"> Break record </item><item field="Description" lang="ar-SA"><P align=right>Break record &nbsp; 9/12/2010 Break record " National " Men Poetry Activities . </P></item></data></div>
<div><b>LocationInInteractiveMap:</b> Don't Show</div>
<div><b>Latitude:</b> 25.266024</div>
<div><b>Longitude:</b> 51.443814</div>
<div><b>EventLogo:</b> <img alt="" src="/SiteCollectionImages/Event%20Images/Default.png" style="BORDER: 0px solid; "></div>
]]></description>
so how i am getting tag value from this html code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
试试这个,
从
API 级别 1 开始
Try this,
And
Since: API Level 1
您想在哪里显示此描述值?如果您想在
TextView
中显示它,请编写:或者
您可以在
WebView
中加载描述字符串值>:Where you want to display this Description value? If you want to display it inside the
TextView
then write:Or
You can load the Description string value inside the
WebView
: