如何在android中使用SAXparsing解析以下代码?
<channel>
<pubDate> <![CDATA[ 1301565012]]> </pubDate>
<name><![CDATA[ Nanopress]]> </name>
<link><![CDATA[ http://www.nanopress.it ]]> </link>
<description> <![CDATA[ Tutte le ultime news di Nanopress ]]> </description>
<language><![CDATA[ it ]]> </language>
<item> <ID>0</ID> <url>
<![CDATA[ http://www.politica24.it/articolo/giustizia-prescrizione-breve-caos-alla-camera-il-video/10129/ ]]> </url>
<category><![CDATA[ NanoPress ]]> </category>
<title> <![CDATA[ Prescrizione breve: caos alla Camera ]]> </title>
</channel>
<channel>
<pubDate> <![CDATA[ 1301565012]]> </pubDate>
<name><![CDATA[ Nanopress]]> </name>
<link><![CDATA[ http://www.nanopress.it ]]> </link>
<description> <![CDATA[ Tutte le ultime news di Nanopress ]]> </description>
<language><![CDATA[ it ]]> </language>
<item> <ID>0</ID> <url>
<![CDATA[ http://www.politica24.it/articolo/giustizia-prescrizione-breve-caos-alla-camera-il-video/10129/ ]]> </url>
<category><![CDATA[ NanoPress ]]> </category>
<title> <![CDATA[ Prescrizione breve: caos alla Camera ]]> </title>
</channel>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Android SDK 中包含
org.xml.sax
包,您可以像在基本 Java 应用程序中一样解析 xml。创建一个扩展
DefaultHandler
的类,实例化一个SAXParserFactory
并开始解析The package
org.xml.sax
is included in the Android SDK, you can parse xml like if you were in a basic Java application.Create an class which extends
DefaultHandler
, instanciate aSAXParserFactory
and start the parsing