androidandroid-xmlsaxparserxmlpullparserandroid-parser

Android: Best parser to parse XML data


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.

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.


Solution

  • 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.