title: Stax vs Sax vs DOM parser?
body: <p>i went thru  <a href="http://en.wikipedia.org/wiki/StAX" rel="nofollow">wiki</a> link. Got some questions based on it.</p>
  
  <p>As per my understanding we should go for one of these parser based on below criteria</p>
  
  <p><strong>DOM Parser :-</strong> File is small and need to traverse in both direction i.e backward/forward</p>
  
  <p><strong>SAX Parser :-</strong> Go for this when you don't have requirement to move in backward direction as file small or large does not matter becoz its always better in terms of performance.</p>
  
  <p><strong>Is this correct?</strong></p>
  
  <p>I have heard recently about STAX and went thru wiki link. It says</p>
  
  <pre><code>StAX was designed as a median between these two opposites(DOM ans SAX).
  </code></pre>
  
  <p>With this i got impression we can move in backward/forward with STAX but googling says we can move only in forward direction
  with STAX. So how come stax offers the advantage of DOM ?</p>
  
  <p>Link also says</p>
  
  <blockquote>
    <p>The application moves the cursor forward - 'pulling' the information
    from  the parser as it needs. This is different from an event based
    API   - such as SAX -  which 'pushes' data to the application -
    requiring the application to maintain state between events as
    necessary to keep track of location within the document</p>
  </blockquote>
  
  <p>So STAX uses pull approach while sax uses push approach <strong>but how does it matter to developer whether its pull or push
  until and unless its good in performance or require less effort?</strong></p>