When to Use DOM


The difference between SAX and DOM is the difference between sequential, read-only access and random, read-write access (an analogy is SAX parsing XML on the time axis and DOM parsing on the space axis). If, during processing, there is a need to move laterally between sibling elements or nested elements or to back up to a previous element processed, DOM is probably a better choice.

However, creating and manipulating DOMs is memory-intensive, and this makes DOM processing a bad choice if the XML is large and complicated or the JVM is memory-constrained, as in J2ME devices.




Java Web Services Architecture
Java Web Services Architecture (The Morgan Kaufmann Series in Data Management Systems)
ISBN: 1558609008
EAN: 2147483647
Year: 2005
Pages: 210

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net