安卓:解析XML数据的最佳解析器 [英] Android: Best parser to parse XML data

查看:374
本文介绍了安卓:解析XML数据的最佳解析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发中,第一次我会从XML文件从远程服务器的解析数据的应用程序。

I am developing an application in which the first time I am going to parse data from an xml file coming from a remote server.

但我不能够选择其中解析器是有效的还是最适合的解析。由于主要有三种类型的解析,这是我知道的:

But i am not able to select which parser is efficient or best suited for parsing. As there are mainly three types of parsing, which i know :

  1. SAX
  2. XMLPullParsing
  3. DOM

这是分析数据的最佳解析器?作为我搜索的谷歌,发现上面的解析器的正面和负面的两侧。但我无法确定这是最高效的。

Which is the best parser to parse data? As I searched on Google and found the positive and negative both sides of the above parsers. But I was not able to determine which is the most efficient.

该XML有大量的数据与一些标签。

The XML has heavy data with a number of tags.

请指导我,建议我该解析器我应该使用,因为我使用解析在我的应用程序的第一次。

Please guide me and suggest me which parser I should use as I am using parsing in my application for first time.

推荐答案

在所有的XML解析器的SAX解析器是最快的国家之一,所以你可以去为它毫无疑问....如果你需要读取和写入数据从XML,你可以去DOM。使用SAX解析器你将只能够从XML读取数据。由于这两个都是在列表的顶部,你没有必要觉得XMLPullparser的。

In all the XML parser's Sax parser is the fastest one so you can go for it with no doubt ....If you need to read and write the data from an XML you can go for DOM. Using the SAX parser you will be only be able to read the data from the XML. Since these two are in the top of the list you no need to think of the XMLPullparser.

这篇关于安卓:解析XML数据的最佳解析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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