i went thru wiki link. Got some questions based on it.
As per my understanding we should go for one of these parser based on below criteria
DOM Parser :- File is small and need to traverse in both direction i.e backward/forward
SAX Parser :- 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.
Is this correct?
I have heard recently about STAX and went thru wiki link. It says
StAX was designed as a median between these two opposites(DOM ans SAX).
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 ?
Link also says
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
So STAX uses pull approach while sax uses push approach but how does it matter to developer whether its pull or push until and unless its good in performance or require less effort?