I want to create a basic RSS feeder app for Android and I don’t know which library to choose:
SAX or DOM. Which should I choose?
Does anyone have any experience with either on an Android platform?
Any tips?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A SAX based parser will allow you to store only the information that you require with an event handler style interface, while DOM based methods will parse the whole file into an object model. Personally I would use SAX for both it’s speed and memory advantages (especially on a mobile environment — if you don’t know the length of the XML at runtime, you could end up with a huge model). SAX allows you to construct your own objects/information as required in the format you want without having the default object model stored on top.
In general however, a SAX based parser is useful if the XML contains machine readable data, and a DOM based parser is useful when you have structured document style data. See here for more information.