Which statement is true about StAX?

Which statement is true about StAX?

Which statement is true about StAX?

A.
StAX provides client parsing control with memory usage similar to DOM.

B.
StAX allows clients to start, pause and resume the parsing process.

C.
StAX is the only XML parsing approach supported with JAX-WS.

D.
StAX is a more efficient version of SAX, based on newer XML technology.



Leave a Reply 3

Your email address will not be published. Required fields are marked *


Aneesh

Aneesh

B

Mohamed Fayek Saber

Mohamed Fayek Saber

correct

Mohamed Fayek Saber

Mohamed Fayek Saber

http://tutorials.jenkov.com/java-xml/sax-vs-stax.html

Both SAX and StAX are stream / event oriented XML parsers, but there is a subtle difference in how they work. SAX uses a “push” model, and StAX uses a “pull” model.

The SAX Push Model :
With a push model you have not control over how and when the parser iterates over the file. Once you start the parser, it iterates all the way until the end, calling your handler for each and every XML event in the input XML document.

The StAX Pull Model :
The StAX pull model means that it is your “handler” class that calls the parser, not the other way around. Thus your handler class controls when the parser is to move on to the next event in the input. In other words, your handler “pulls” the XML events out of the parser. Additionally, you can stop the parsing at any point.