Android的XML来自互联网解析 [英] Android XML Parsing from Internet

查看:104
本文介绍了Android的XML来自互联网解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待从互联网解析XML Android设备有一点帮助。我有一个查看一下,不能让我的头周围,我觉得很多东西在网上是我需要的东西太复杂了。你会推荐的家伙?下面是一些XML即时通讯寻求分析的一个片段。

 < weatherdata>
< timetags>
<项目名称=日期>
<价值→20/03/2012< /值>
<单位/>
<图像/>
<类别和GT;动态< /班>
<描述>在当前的日期和LT; /描述>
< /项目>
<项目名称=时间>
< 11;值GT:2012年&LT○○年三月二十零日; /值>
<单位/>
<图像/>
<类别和GT;动态< /班>
<描述>在当前的时间和LT; /描述>
< /项目>`


解决方案

有两个解析器:SAX和DOM,你可能已经GOOGLE了它。如果你给时间他们没有那么复杂。我发现这个例子很有益。它提供了用于详细解释这两个分析器例子。 http://www.java-samples.com/showtutorial.php?tutorialid=152

I'm looking A little help on parsing XML from the internet to an Android Device. I've had a look into it and cant get my head around it, i feel alot of the stuff online is too complicated for what I need. What would you guys recommend? Here is a snippet of some of the XML im looking to parse.

<weatherdata>
<timetags>
<item name="date">
<value>20/03/2012</value>
<unit/>
<image/>
<class>dynamic</class>
<description>The current date</description>
</item>
<item name="time">
<value>11:00 on 20 March 2012</value>
<unit/>
<image/>
<class>dynamic</class>
<description>The current time</description>
</item>`

解决方案

There are two Parsers : SAX and DOM as you might have googled it. They are not that complicated if you give time. I found this example really helpful. It provides example for both parser in detail explanation. http://www.java-samples.com/showtutorial.php?tutorialid=152

这篇关于Android的XML来自互联网解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆