1. Dom Mode:
The full name of the DOM is the Document Object model, which is also known as the documentation.
The random access provided by the DOM tree provides a lot of flexibility in the development of the application, and it can control the content of the entire XML document in any arbitrary way. However, because the DOM parser transforms the entire XML document into a DOM tree in memory, the need for memory is higher when the document is larger or the structure is more complex. Also, the traversal of a complex tree is a time-consuming operation. Therefore, the DOM parser has higher requirements for machine performance and is not very efficient to achieve. However, because the idea of tree structure adopted by DOM parser is consistent with the structure of XML document, and because of the convenience of random access, Dom parser has a wide use value.
2. Sax Mode:
The full name of Sax is the simple API for XML, also known as the XML trivial application interface. Unlike the DOM, the access pattern provided by Sax is a sequential pattern, which is a way to read and write XML data quickly. When parsing an XML document using the SAX parser, a series of events are triggered and the corresponding event handlers are activated, and the application accesses the XML document through these event handlers, and the Sax interface is also referred to as the event-driven interface.
3, Jdom Way:
Jdom is an open source project that uses pure Java technology to parse, generate, serialize, and manipulate XML documents based on the tree structure. (http://jdom.org);
JDOM directly to the Java programming service. It takes advantage of the many features of the more powerful Java language (method overloading, collection concepts, etc.) to effectively combine the functions of sax and DOM;
Jdom is a new API function that reads, writes, and operates XML in the Java language. These API functions are optimized for immediate, simple, and efficient conditions.
4, dom4j:
JAVA Parsing xml