Hello, The following points you have told is contradicting/confusing. Could you/somebody please make it bit more clear. 1. Document is huge but there is a Constraint for Memory - Which one should be used.. SAX or DOM. 2. If Speed is the constraint - Which one is best.. SAX or DOM Other points are good and clear. Thanks for your efforts. =Rajan= [ December 28, 2002: Message edited by: Rajan Thiyagarajan ]
- IBM Certified - eBusiness Solution Technologist
- IBM Certified Developer - XML
- Microsoft Certified Application Developer
- Tibco Certified Professional
- Sun Certified Java Professional
Perseverance can make miracles happen
posted 17 years ago
Hi, For Speed : DOM is the Best. But If there is a memory constraint then we have to choose SAX. Over all Dom - speed SAX - Limited Memory Use. Thanks, Shakthy,
Be careful when you talk about speed - without qualifying it can be pretty confusing. The parsing speed for SAX is faster than DOM for significantly large docuements. I say so because for smaller documents(<1MB) the difference in speed is insignificant unless you are running an age old PC. The parsing speed ie., time taken for the parse() call to return for DOM is slower because it has to allocate memory and creates the DOM tree with all the cross references between nodes. The navigation speed, for lack of a better word is obviously faster in a DOM scenario because the entire document is in memory. If you were to navigate the XML document using SAX, you will have to parse it all over again! Just my two cents worth...
Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
posted 17 years ago
Originally posted by Roseanne Zhang: For speed, sax is the best. However, if you need to go through it more than once, dom is the best.
because sax is not for that purposes.
Get off me! Here, read this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book