Compartilhar via


XML SAX Application Development

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

SAX2 provides Microsoft® eMbedded Visual C++® interfaces, and offers an efficient alternative to processing through the Document Object Model (DOM). When you use the DOM to manipulate an XML file, the DOM reads the file, breaks it up into individual objects; such as elements, attributes, and comments; and then creates a tree structure of the document in memory. The benefit of using the DOM is that you can individually reference and manipulate each object, called a node. However, creating a tree structure for a document, especially a large document, requires a significant amount of memory.

Unlike the DOM, SAX2 is stream and event based; it generates events as it finds specific symbols in an XML document. One advantage of SAX2 is that it reads a section of an XML document, generates an event, and then moves on to the next section. Because SAX2 processes documents in this serial fashion, it uses less memory than the DOM and is therefore better for processing large documents. SAX2 can create applications that abort processing when a particular piece of information is found.

For more information about developing with XML SAX, see this Microsoft Web site.

See Also

Concepts

SAX2 Developer Guide

Other Resources

XML SAX