Reference articles
1:http://blog.csdn.net/clemontine/article/details/53011362
2:http://www.jb51.net/article/98456.htm
http://blog.csdn.net/javawebrookie/article/details/49560643
Parsing XML in 1.DOM mode
Dom parsing is an XML file loaded into memory, assembled into a DOM tree, and then through the relationship between nodes and nodes to parse the XML file, and platform-Independent, Java provides a basic parsing XML file API, understanding is relatively simple
Advantages
① allows applications to make changes to data and structures.
② access is bidirectional and can be navigated up and down in the tree at any time, capturing and manipulating any part of the data.
Disadvantages
① usually needs to load the entire XML document to construct the hierarchy, consuming resources.
Parsing XML in 2.SAX mode
Event-driven, one-by-one parsing, for parsing XML data only, hard to encode, and difficult to access multiple different data in the same document at the same time
Parsing XML in 3.JDOM mode
Simplifies interaction with XML and is faster than using the DOM, simplifies APIs by using only specific classes instead of interfaces, and is easy to use
Parsing XML in 4.dom4j way
Jdom is a kind of intelligent branch, the function is strong, suggest skilled use
Four ways to "reprint and organize" Java to parse or generate XML