The company that I work just for started full-blown e-commerce and web development using Java, XML, and WebSphere and is now going through the process of standardizing which type of parser we should use. It seems like the developers are split over DOM and SAX. I would like to know if anyone has a recommendation as to whether DOM or SAX would be a better fit for a high-volume, enterprise development shop?
You MUST analyze your requirements in detail - 1. Bulk of data - if you have tens of megabytes, SAX is your only path. This is because a DOM must be all in memory - the various element objects plus all the text data at two bytes per character - it mounts up fast. 2. Type of data usage - if you want to correlate between entries, search, or otherwise manipulate the hierarchy, SAX is going to be VERY hard to apply. 3. Frequency/volume of use - if users are going to be hitting your catalog every few seconds, it makes sense to keep it all in memory in a DOM. 4. How dynamic is the data - if you have to be able to modify entries frequently, DOM is the way to go. 5. Do you really need to store XML? I know of one application where the SQL database output goes to make a temporary XML file just so a XSL transform can be applied to make final output. Bill
posted 18 years ago
Then perhaps the solution shouldn't be one or the other, rather which should be used under various circumstances. That really helps. Thanks!
All of the following truths are shameless lies. But what about this tiny ad:
how do I do my own kindle-like thing - without amazon