Simple API for XML
จากวิกิพีเดีย สารานุกรมเสรี
- บทความนี้มีชื่อเป็นภาษาอังกฤษ เนื่องจากยังไม่มีชื่อภาษาไทยที่กระชับหรือเหมาะสม ไม่รู้วิธีอ่านในภาษาไทย หรือต้องการคงชื่อเฉพาะไว้ตามต้นฉบับ
Simple API for XML (SAX) เป็นวิธีการอ่านข้อมูลจากเอกสาร XML โดยเป็นทางเลือกหนึ่งนอกเหนือไปจาก Document Object Model หรือ DOM
ตัวอ่านข้อมูลที่ใช้วิธี SAX จะอ่านข้อมูล XML ในรูปของสตรีมทิศทางเดียว ทำให้ไม่สามารถอ่านข้อมูลที่อ่านไปแล้วได้ โดยไม่ต้องอ่านใหม่ทั้งหมด ซึ่งวิธีการนี้จะได้ประสิทธิภาพที่ดีกว่า DOM ที่อ่านข้อมูลทั้งหมดก่อนแล้วจึงประมวลผล ในเฉพาะกรณีที่เอกสารมีขนาดใหญ่