Posts

Showing posts from October, 2011

XML parsing PULL and PUSH methodologies.

What is XML push parsing? A push parsing model is a model where the parser pushes parsing events to the application. SAX (stands for Simple API for XML) is the most common example of a push parsing API for XML. An application using SAX would define a number of callback that would be called by the parser when certain events occur. for example, an application can define a startElement method, that the parser will call every time it sees the beginning of a new element. SAX is a one-pass parser that goes through the document once from begging to end and sends one event to the calling application for each XML construct it encounters. What is XML pull parsing? A pull parsing mode is a model in which the application drives the parser (in contrast to the push model, where the parser drives the application), by pulling parsed xml constructs from the parser one by one, according to its needs. StAX (Streaming API for XML) is the most prevalent Java pull parsing API. in the StAX model, an a