JaVa
   

When to Use SAX

In general, SAX processing is faster than DOM, because it does not keep track of or build in memory trees of the document, thus consuming less memory, and does not look ahead in the document to resolve node references. Since access is sequential, it is well suited to apps interested in reading XML data and apps that do not need to manipulate the data, such as apps that read data for rendering and apps that read configuration data defined in XML. However if the primary motivation is to read the data so as to subsequently process it as Java objects, JAXB is a better choice. This is covered in .

apps that need to filter XML data by adding, removing, or modifying specific elements in the data are also well suited for SAX access. The XML can be read serially and the specific element modified.


JaVa
   
Comments