When should I choose SAX over StAX?
问题 Streaming xml-parsers like SAX and StAX are faster and more memory efficient than parsers building a tree-structure like DOM-parsers. SAX is a push parser, meaning that it's an instance of the observer pattern (also called listener pattern). SAX was there first, but then came StAX - a pull parser, meaning that it basically works like an iterator. You can find reasons why to prefer StAX over SAX everywhere, but it usually boils down to: "it's easier to use". In the Java tutorial on JAXP StAX