SAX解析器VS XMLPull分析器 [英] SAX parser vs XMLPull parser

查看:137
本文介绍了SAX解析器VS XMLPull分析器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我理解之间如何SAX解析器作品相较于XMLPull解析器的差异。 其实有一个pretty的很好的解释在这里:

I understand the difference between how the SAX parser works vs the XMLPull parser. In fact there's a pretty good explanation here:

<一个href="http://www.firstobject.com/xml-reader-sax-vs-xml-pull-parser.htm">http://www.firstobject.com/xml-reader-sax-vs-xml-pull-parser.htm 这篇文章是有点.NET为中心的,但其中的概念适用。

http://www.firstobject.com/xml-reader-sax-vs-xml-pull-parser.htm The article is a bit .NET centric but the concepts apply.

虽然我同意作者的意见,即拉解析器是比较容易的工作,我是pretty的困惑,其中解析器的类型将在哪些情况下更好。 如果任何人都可以摆脱任何轻点我的一些更多的阅读我想AP preciate吧。

While I agree with the author's opinion that the Pull parser is easier to work with, I'm pretty confused as to which type of parser would be better in which situations. If anyone could shed any light and point me to some more reading I would appreciate it.

感谢您。

推荐答案

我发现他们都吸。 (我有一个更好的解决方案建议)

I find that they both suck. (And I have a better solution to suggest)

您应该使用简单的基于标注XML库。我喜欢它,使用它为我所有的项目。如果您阅读教程的话,我想你会发现,它就能做到这一点,你想和更快和更低的code一切。 (这样是不太容易出现的错误)内部的库使用那些你问到做繁重的解析器。

You should use the Simple annotation based XML library. I love it and use it for all of my projects. If you read through the tutorial then I think you will find that it will be able to do everything that you want and much faster and with less code. (Thus being less bug prone) Internally the library uses those parsers that you were asking about to do the heavy lifting.

您可以再读取我的对包括它在Android项目的,如果你想的博客文章。 (它会在每个版本的Andr​​oid的工作从ATLEAST 1.5了,这意味着每个人基本)

You can then read my blog post on including it in an Android project if you want. (It will work in every version of Android from atleast 1.5 up which means for everybody basically)

这篇关于SAX解析器VS XMLPull分析器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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