Which method of using Android to parse XML

Source: Internet
Author: User

Sax is a "push" model for handling XML event-driven
The advantage is an XML parser that is fast and takes up less memory, and what data it needs to reload and parse.
The downside is that it does not record the relationship of the labels, but to let your application handle them, which increases the burden on your program.

The DOM is a Document object model that allows the DOM to access and modify the content and structure of a document in a platform-independent and linguistic manner.
Dom technology allows the user page to dynamically change, such as the ability to dynamically display or hide an element, change their properties, add an element, and so on, Dom technology makes the page interactivity greatly enhanced.
The disadvantage is that when the DOM parses an XML file, all the contents of the XML file are stored in memory in the document tree.

Pull parsing is similar to sax parsing,
Pull parsing is not the same as Sax parsing where pull reads an XML file and triggers the corresponding event call method to return a number
and pull can control where in the program you want to parse to stop parsing.


-----------------------
The DOM approach is most intuitive and easy to understand, but only suitable for use when the XML document is small.
The SAX approach is more suitable for use in ophone/android systems because it takes up less memory than DOM and is suitable for processing larger XML documents.
The final pull method is similar in use to sax, but is better suited for situations where XML document parsing needs to end prematurely.

Which method of using Android to parse XML

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.