on 11-28-2007 9:46 AM
Give me some specific points(7-8) on the disadvantages of SAX parser.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.