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.