Android parsing XML and androidxml
1. XML: extensible markup language.
Extensible Markup Language is a markup language similar to hypertext markup language.
It is designed to transmit data rather than display data.
Its mark is not predefined. You need to customize the tag.
It is designed to be self-descriptive.
Is the W3C recommendation standard.
2. Three Ways for Android to parse XML
(1). SAX Parsing
Http://www.cnblogs.com/zhangmiao14/p/6183505.html
(2) DOM Parsing
Http://www.cnblogs.com/zhangmiao14/p/6183976.html
(3). Pull Parsing
Http://www.cnblogs.com/zhangmiao14/p/6184201.html
3. Technical Summary
For Android mobile devices, because the device resources are precious and the memory is limited, we need to select the appropriate technology to parse XML, which is conducive to improving the access speed.
(1) when processing XML files, DOM parses the XML files into a tree structure and puts them into the memory for processing. When XML is relatively small, DOM can be selected because it is simple and intuitive.
(2). SAX uses an event as the mode for parsing XML files. It converts XML files into a series of events and is determined by different event processors. When the XML file is large, it is reasonable to select the SAX technology. Although the amount of code is large, it does not need to load all XML files into the memory. This is more effective for limited Android memory, and Android provides a traditional method of using SAX and a convenient SAX package. Using the Android. util. xml class is simpler than using SAX.
(3). XML Pull parsing does not end the listening element like the SAX parsing, but completes most of the processing at the beginning. This helps to read XML files early and greatly reduce the parsing time. This optimization is especially important for mobile devices with slow connection speeds. The XML Pull parser is more effective when the XML document is large but only a part of the document is required.