JAVA Parsing xml

Source: Internet
Author: User

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

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.