SAX parser vs XMLPull parser

2019-01-21 03:33发布

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

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

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.

Thank you.

7条回答
狗以群分
2楼-- · 2019-01-21 04:17

I find the SAX model easier to work with in one specific situation: where you are going to build your own in-memory representation of the entire document (or at least major portions of it) with custom data structures. (If you aren't particular about the data structure, then the DOM parser already does this.)

查看更多
登录 后发表回答