There are four ways in which Java parses XML classics:
1.dom 2.sax 3.jdom 4.dom4j personally feel dom4j useful, but I only used jdom.
Android I know in two ways sax and pull
SAXthe way is characterized by the need to parse out the entire document before it is returned, if in aXMLin the documentation we only need the previous part of the data, but usingSAXThe entire document will still be parsed, althoughXMLmost of the data later in the document we don't really need to parse, so this actually wastes the processing resources.
The pull parser and SAX parser are different but have similarities. The difference is that the SAX parser works by automatically pushing events into the registered event handler, so you can't control the active end of the event's processing, and the pull parser works by allowing your application code to proactively get events from the parser, just because it's actively getting events, Therefore, you can no longer get the event after the desired condition has been satisfied, ending the parsing. This is the main difference between them.
And their similarity in the run mode, the pull parser also provides a sax-like event (Start document start_document and end document end_document, start element Start_tag and end element End_tag, Encounter element content text , etc.), but need to call the next () method to extract them (active fetch event).
Pull is a way of parsing XML embedded in Android.
PullThe parser is compact, lightweight, quick to parse and easy to use, ideal forAndroidused in mobile devices,Androidthe system internally resolves variousXMLis also used PullParser,AndroidIt is recommended that developers use Pullanalytical techniques. PullAnalytic technology is a third-party development of Open source technology, it can also be applied toJavasedevelopment.
PULL  How it works:
XML Pull the start and end elements are provided. When an element starts, you can call parser. nexttext extracts all character data from the XML document. The enddocument event is automatically generated when parsing to the end of a document.