The DOM method directly loads all XML files to the memory and creates a DOM tree. Features: readable and writable, supports XPath, but it is very slow and occupies 10 multiples of XML memory, cannot process large files.
The sax method is the event notification mechanism, which processes xml a Little Bit. Every time a node is analyzed, the processing logic implemented by the user is called. Features: very fast, almost no memory occupied, only read, you can only read the specified content once. You cannot read the specified content or read the content repeatedly. APIs are more difficult to use than Dom.
VTD-XML is compatible with the advantages of these two XML processing technologies, first scan the XML file in binary mode, a binary index for all nodes, this requires only 1-times the amount of memory in XML. Then, you only need to find the offset from the index for the read operation. VTD-XML's XPath implementation is also based on this principle, so very fast.
Relatively sax: it can be modified to read and read at random or repeatedly,
DOM: memory usage is more than twice that of XML, and Dom is usually 10 times. It supports high-speed XPath expressions.
The processing efficiency of VTD-XML is several times that of DOM: http://vtd-xml.sourceforge.net/benchmark1.html
Address: http://vtd-xml.sourceforge.net/
Principle Introduction: http://vtd-xml.sourceforge.net/DevGuide/0.html