Thursday Apr 26, 2007

StAX (JSR 173)

A very nice introduction of Streaming API for XML is provided in this article. In summary, we can understand StAX by compairing it with SAX :

 SAX (Simple API for XML) : Push API (observer design pattern... Parser feed the content of the document to the application as soon as they see it). Only reading of document is allowed.

StAX (Streaming API for XML) : Pull API (iterator design pattern... Client program asks the parser for the next piece of information ). Both read and write are possible.

There are many similarities in these 2 APIs -

Ease of Use, CPU and memory efficient, Forward only and No XPath capability. 

Java Web Service tutorial is an excellent document to learn more about StAX. 

About

manishkg

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today