Android study note 07. xml file parsing

Source: Internet
Author: User

1. Concepts

XML: Extensible Markup Language, similar to the HTML tags. Scalability refers to the absence of prescribed, restricted, and fixed tags. There are two kinds of parsing Methods: Sax and Dom.

DOM: loads all XML documents into the memory, parses them into a tree, and then performs operations. If the XML document is large, the effect is not good.

Sax: Simple API for XML is an interface and a software package. It scans documents in a row-by-row order and parses documents while scanning. You can stop parsing documents as needed at any time.

However, operations are complex and inconvenient. It is difficult to add or delete data to or from a document. As an interface, Sax is a standard interface for event-driven XML parsing.

2. series of events during file Splitting:

(1. Create event processingProgram

(2) create a SAX Parser

(3) Allocate the event handler to the parser

(4) parse the document and send each event to the handler

 

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.