HI there, I prepared some list (for my use), describing Merits & demerits of DOM & SAX. If iam wrong somewhere plz correct me. If i missed anything add to that
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 ]
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...