Simple API for XML

Simple API for XML(보통 SAX라고 한다)는 XML문서를 애플리케이션에서 사용하기 위한 API이다.

SAX는 XML 파일을 해석하기 위해 DOM 대신 사용된다. 이름을 보면 알 수 있다시피 SAX는 DOM에 비해 단순한 인터페이스를 갖고 있으며, 처리해야할 파일이 많거나 큰 경우에 적합하다. 그러나, 데이터 내용을 조작할 수 있는 기능은 상대적으로 적다고 볼 수 있다.

SAX는 이벤트 중심의 인터페이스이다. 프로그래머가 일어날 수 있는 이벤트를 설정해 놓으면, SAX는 그 이벤트가 일어났을 때 제어권을 가지고 상황을 처리한다. SAX는 직접 XML 파서와 함께 일한다. 그러므로 배포되는 XML 파서와 함께 배포되는데 예를 들어서 ApacheXerces도 SAX 클래스를 포함하고 있다.

 <?xml version="1.0" encoding="UTF-8"?>
 <DocumentElement param="value">
     <FirstElement>
         &#xb6; Some Text
     </FirstElement>
     <?some_pi some_attr="some_value"?>
     <SecondElement param2="something">
         Pre-Text <Inline>Inlined text</Inline> Post-text.
     </SecondElement>
</DocumentElement>

같이 보기

외부 링크

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.