DOM mode, Sax mode and Stax mode of XML parsing in Java 3
•
Java
Let's briefly talk about the first three methods:
DOM mode: personal understanding is similar Net, the parsing efficiency is not high and takes up memory, which is not suitable for the parsing of large XML; Sax mode: event based parsing. When parsing to a part of XML, a specific event will be triggered. You can define what to do when the event is triggered in the user-defined parsing class; I feel a very different way, I don't know Net system? Stax way: personal understanding is similar Net, with high efficiency and less memory, it is suitable for parsing large XML; However, Sax has been used before. This article mainly introduces JAXB, and only the main code is pasted here:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码