Home | | Service Oriented Architecture | Disadvantages of SAX

Chapter: XML and Web Services : Building XML-Based Applications : Parsing XML Using SAX

Disadvantages of SAX

SAX is not a perfect solution for all problems. For instance, it can be a bit harder to visualize compared to DOM because it is an event-driven model.

Disadvantages

 

SAX is not a perfect solution for all problems. For instance, it can be a bit harder to visualize compared to DOM because it is an event-driven model. SAX parsing is “single pass,” so you can’t back up to an earlier part of the document any more than you can back up from a serial data stream. Moreover, you have no random access at all. Handling parent/child relationships can be more challenging as well.

Another disadvantage is that the current SAX implementations are read-only parsers. They do not provide the ability to manipulate a document or its structure (this feature may be added in the future). DOM is the way to go if you want to manipulate a docu-ment in memory.

 

There is no formal specification for SAX. The interfaces and behavior are defined through existing code bases. This means there is no way to validate a SAX parser or to determine whether it works correctly. In the words of Dave Megginson, “It’s more like English Common Law rather than the heavily codified Civil Code of ISO or W3C specifications.”

 

Even considering these limitations, SAX does its job well. It’s lightweight, simple, and easy to use. If all you want to do is read XML, SAX will probably do what you need.


Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
XML and Web Services : Building XML-Based Applications : Parsing XML Using SAX : Disadvantages of SAX |


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2024 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.