tag:blogger.com,1999:blog-8712770457197348465.post8076110144781454055..comments2024-03-17T23:01:26.872-07:00Comments on Javarevisited: Difference between DOM and SAX Parsers in Javajavin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-8712770457197348465.post-34259352419383890732021-06-08T07:08:26.054-07:002021-06-08T07:08:26.054-07:00I understand from your post that for large xml fil...I understand from your post that for large xml files its better to use SAX but by large you mean how much large? .Nageshhttps://www.blogger.com/profile/02889583520310142188noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-26066003742988386392021-06-08T07:07:01.932-07:002021-06-08T07:07:01.932-07:00My javanet connection on scratch dayMy javanet connection on scratch dayNageshhttps://www.blogger.com/profile/02889583520310142188noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-37009224378144250762019-10-21T00:11:43.778-07:002019-10-21T00:11:43.778-07:00I understand from your post that for large xml fil...I understand from your post that for large xml files its better to use SAX but by large you mean how much large? .<br /><br />Also when to use JAXB?Anonymoushttps://www.blogger.com/profile/11256794532149706907noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-19171149669069740032016-09-13T06:35:03.671-07:002016-09-13T06:35:03.671-07:00When should we prefer the JAXB ? DOM SAX and JAXB...When should we prefer the JAXB ? DOM SAX and JAXB <br />Anonymoushttps://www.blogger.com/profile/06509713827537297321noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-32356253048032514852016-08-08T21:02:51.497-07:002016-08-08T21:02:51.497-07:00Unless and until you dont want to recreate the sam...Unless and until you dont want to recreate the same xml file again with minor modification sax parser is recomanded. Infact for all other case sax with jaxb.<br />Point to note is writing a parser using sax alone is not as easy as transversing dom.Anonymoushttps://www.blogger.com/profile/18373562737994915919noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-77991064120102437942016-08-08T16:47:36.547-07:002016-08-08T16:47:36.547-07:00Can you please elaberate your second point of dom ...Can you please elaberate your second point of dom being faster because of being inmemory? As far as i understand dom create a in memory hierarchical representation of xml after parsing while sax only parse it and never represent any xml.Anonymoushttps://www.blogger.com/profile/18373562737994915919noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-59909145901586720832016-04-21T04:11:30.771-07:002016-04-21T04:11:30.771-07:00which parser should we use when we have attachment...which parser should we use when we have attachments in xml file??<br />Anonymoushttps://www.blogger.com/profile/01785076709182918019noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-57570157584613981792015-11-03T03:06:31.013-08:002015-11-03T03:06:31.013-08:00"DOM parser is faster than SAX because it acc..."DOM parser is faster than SAX because it access whole XML document in memory" for the first look,it seems to be wrong but writers actually wants to say it uploads all data into the memory for once than it works fine until the data overflows from memory.Summary for large data files Sax is better than dom.Anonymoushttps://www.blogger.com/profile/08249675789845830430noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-26096363151855229042015-04-22T05:10:39.394-07:002015-04-22T05:10:39.394-07:00by comparing memory based performance, SAX is bett...by comparing memory based performance, SAX is better is it correct?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-79213957689936432182013-07-12T23:14:22.090-07:002013-07-12T23:14:22.090-07:00Yes the SAX parser is faster then DOM that is what...Yes the SAX parser is faster then DOM that is what the writer had explained before the point.<br /><br />2) DOM parser is faster than SAX because it access whole XML document in memory.<br /><br />I think it was just a typoAparnanoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-63489978864462972032013-06-26T14:44:58.112-07:002013-06-26T14:44:58.112-07:00Where are you getting this from?
2) DOM parser is...Where are you getting this from?<br /><br />2) DOM parser is faster than SAX because it access whole XML document in memory.<br /><br />Isn't it the other way round?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-7750576310291333302012-10-01T23:54:44.800-07:002012-10-01T23:54:44.800-07:00When do you choose DOM vs SAX parser in Java ? Fro...When do you choose DOM vs SAX parser in Java ? From this post I see choose SAX vs DOM parser when XML file is Big, Java heap is limited and performance is not a concern. While Use DOM vs SAX parser if XML document is small, you have enough Java memory or heap and performance is important i.e. you want to parse XML document quickly. Does these observations are correct ?Akhileshwarnoreply@blogger.com