Home  >  Article  >  Backend Development  >  The difference between XML PULL and PUSH technology

The difference between XML PULL and PUSH technology

黄舟
黄舟Original
2017-03-31 14:35:221955browse

PULL and SAX are both based on events, but the most important difference between the two should be:

SAX can be considered as "PUSH", as opposed to PULL. Because Parser will pass the data to the callback function for processing when it encounters a specific event source. In this sense, the data is "pushed" to the user, while the PULL method is used when it encounters a specific event. When users get what they are interested in from Parser, it feels like the data is "pulled" down.

Another difference is: during the PULL parsing process (while loop), you can exit the loop; but in the SAX process, once parsing starts To complete the analysis.

In addition, a slight expansion:
There are currently two main parsing and generation principles. One is to match class names, attributesnames and other information through reflection, and the other is to directly Using jvm bytecode to operate, the efficiency of these two methods is self-evident. Naturally, binary bytecode is more efficient.

The above is the detailed content of The difference between XML PULL and PUSH technology. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn