The advantage is that SAX is faster for initial parse, so for static documents parse using SAX. When dynamic reading or writing is required it is faster to use DOM opposed to parsing the entirety of the document again with SAX. The dynamic objective is not to recreate or re-understand the entirety of the document structure again, but instead to be highly targeted and do only the specific operations needed.
Thanks, Austin Cheney, CISSP -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Scott Sauyet Sent: Tuesday, January 03, 2012 7:25 AM To: The JSMentors JavaScript Discussion Group Subject: [JSMentors] Re: SAX vs DOM Austin Cheney wrote: > ➢ It would be useful if it could be combined with XMLHttprequest > > Why? Why not just use SAX for initial parse and DOM methods there after? What is the use-case for that? I've used both SAX and DOM over the years, but never found a need to combine them. Of course these days, I'm doing XML <-> JSON on the server, and don't use XML at all on the client, but that's another story. -- Scott -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected] -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/[email protected]/ To search via a non-Google archive, visit here: http://www.mail-archive.com/[email protected]/ To unsubscribe from this group, send email to [email protected]
