Handling a Remote Procedural Call that Returns 10 MB of Data (Windows CE 5.0)
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
Send Feedback on this topic to the authors