Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

SAX2 is an excellent choice for handling large amounts of data. For example, consider a scenario in which a client requests XML data from Server A. To respond to the request, an application on Server A queries Server B. Assume that Server B returns 10 megabytes (MB) of data to be passed to the client. With SAX2, you can use a small input buffer, a small work buffer, and a small output buffer because SAX2 processes data in a serial fashion. In contrast, using the DOM allows you to still use a small input buffer, but requires a much larger work buffer (at least 10 MB) and a larger output buffer (10 MB or less). In situations where large amounts of data must be processed, SAX2 offers a significant savings in memory, and usually a savings in performance.

See Also