Peolpe are saying that SAX and PULL are for large documents and DOM are for small documents.
For exampkle ,for a android mobile device with RAM 256. what is the size threshold of the XML document.
Peolpe are saying that SAX and PULL are for large documents and DOM are for small documents.
For exampkle ,for a android mobile device with RAM 256. what is the size threshold of the XML document.
The amount of memory a document takes up in memory is somewhat dependent on the xml library you are using and the structure of the document. However, with libxml (a popular xml library), the document in memory is generally not too much bigger than the document on disk.
There are other considerations besides size when choosing between SAX and DOM. For example, if you can do whatever you need to do with the data in one pass through the document, SAX is a good choice. If you need to move around in the data and revisit particular elements multiple times, DOM is a good choice. If you are going to build your own data structures as you read the XML, SAX is a good choice.
This stackoverflow question has more information: What is the difference between SAX and DOM?