1.

When to use a SAX Parser?

Answer»

You should use a SAX parser when −

  • You can process the XML document in a linear fashion from the top down

  • The document is not deeply nested

  • You are processing a very large XML document whose DOM tree would consume too much memory.Typical DOM implementations use ten bytes of memory to represent one byte of XML

  • The problem to be solved involves only part of the XML document

  • Data is available as soon as it is seen by the parser, so SAX works well for an XML document that arrives over a stream



Discussion

No Comment Found