SAX is an event-driven programming interface for processing XML files. The idea is that the various parts of an XML document will trigger identifiable events which can be caught by a processing program. The XML file is considered as a stream of events. The first and last events are triggered by the start and the end of the document.