java sax parser
java sax parser (SAX) is an API which is use to read XML file data into java program and java sax parser will read XML data in sequential manner.
Advantage of SAX
- SAX is fast processing model.
- SAX parser is less memory intensive means it’s taking less memory to read XML file.
- SAX is based event processing model.
- SAX parser in Java is better suitable for large XML file.
Disadvantage of SAX
- We can not access XML data randomly using SAX parser.
- We can read XML data in forward direction only using SAX Parser.
- SAX doesn’t preserve comments
When to use SAX over DOM
When we small size of XML file then we should go for SAX parser in java.