cancel
Showing results for 
Search instead for 
Did you mean: 

SAX parser

Former Member
0 Kudos

Give me some specific points(7-8) on the disadvantages of SAX parser.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sankar

Disadvantage of SAX are as follows

1)SAX is an event-driven push model for processing XML. It is not a W3C standard,

2)Rather than building a tree representation of an entire document as DOM does, a SAX parser fires off a series of events as it reads through the document.

3)The disadvantage of SAX is that you have to implement the event handlers to handle all incoming events. You must maintain this event state in your application code. Because the SAX parser does not communicate meta-information such as DOM's parent/child

4) you have to keep track of where the parser is in the document hierarchy. Thus, the more complex your documents are, the more complex your application logic becomes.

5)Even though there is no need to load the entire document into memory at one time, a SAX parser still needs to parse the whole document, as with DOM.

6)Probably the biggest problem facing SAX is that it does not have built-in document navigation support such as that provided by XPath. This, coupled with its one-pass parsing, means there is no random access support.

7)This limitation also shows up in namespaces: Elements that have inherited namespaces will not be annotated. These limitations make SAX a poor choice for manipulating or modifying a document

For more details you can refer to link

http://www.oracle.com/technology/oramag/oracle/03-sep/o53devxml.html

hope it may help you

Thanks

sandeep

PS: if helpful reward points

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello,

Even check this....

For a tutorial on the methods of SAX and DOM http://java.sun.com/webservices/docs/1.1/tutorial/doc/

With Regards,

Vidya

GabrielSagaya
Active Contributor
0 Kudos

Disadvantages of SAX Parser

1.Limited API

2. Only traverse the document once.

3.sax is forward only

4.sax is read only

5.does not allow us to traverse the tree

6 modification of the document is difficult

7. SAX does not care how elements relate to one another

with regards

Gabriel

Former Member
0 Kudos

Hello Sankar,

Disadvantages of SAX parser

1) Limited API : Every element is processed through the same event handler

2)Need to keep track of location in document and ,in cases,store temporary data.

3)Only traverse the document once

With Regards,

Vidya

<b>*********PLEASE REWARD WITH POINTS ,IF FOUND USEFUL</b>

prabhu_s2
Active Contributor
0 Kudos

Ur previos post also has the same subject. Change the subject to avoid confusion for the readers. Also ur post seems to be more repetitive

Message was edited by:

Prabhu S