October 1, August 8

Source: Internet
Author: User

XML

What is XML at the beginning.

Later, I learned how to parse XML.

The parsing method is either of the two.

 Dom advantages and disadvantages:

 1. Advantages:

 Using Dom to parse XML documents makes crud easy and fast.

 2. Disadvantages

 
Use Dom to parse XML documents. If the file size is large, the memory consumption is extremely high, which can easily cause memory overflow. Therefore, Dom is not suitable for XML documents with large operations.

 Advantages and disadvantages of sax:

 1. Advantages: fast resolution, low memory usage, and convenient data searching

 2. Disadvantages: It is only suitable for searching data and is not suitable for adding, deleting, and modifying operations in cooperation.

But what we seem to learn is dom4j.

My current level is to look at the dom4j document to get several nodes, get several attributes, and get the content of several text nodes.

However, the XML we use is a file written by ourselves or others for data storage. Generally, we can clearly understand the structure of the file, therefore, you can easily use dom4j to obtain data. for example, permissions in the power system can be stored using XML. easy Maintenance.

 Recently I found that I often have a misunderstanding about XML parsing, that is, I always want to write a common method to parse all the XML. however, I found that this is not very realistic. Every XML is written by myself. Therefore, we can simply parse what XML we use according to the format.

In addition, the properties file is also used to store data.

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.