 | Level: Introductory Nicholas Chase (nicholas@nicholaschase.com), Author, Web site developer
29 Jul 2003 This tutorial examines the use of the Simple API for XML version 2.0.x, or SAX 2.0.x. It is aimed at developers who have an understanding of XML and wish to learn this lightweight, event-based API for working with XML data. It assumes that you are familiar with concepts such as well-formedness and the tag-like nature of an XML document. In this tutorial, you will learn how to use SAX to retreive, manipulate, and output XML data.
Prerequisites
The tutorial assumes that you are familiar with concepts such as well-formedness and the tag-like nature of an XML document. SAX is available in a number of programming languages, such as Java, Perl, C++, and Python. This tutorial uses the Java language in its demonstrations, but the concepts are substantially similar in all languages, and you can gain a thorough understanding of SAX without actually working through the examples.
System requirements
You will need JavaScript enabled on your browser. The examples in this tutorial, should you decide to try them out, require the following tools to be installed and working correctly. Running the examples is not a requirement for understanding.
- A text editor: XML files are simply text. To create and read them, a text editor is all you need.
- JavaTM 2 SDK, Standard Edition version 1.4.x with built-in SAX support (available at http://java.sun.com/j2se/1.4.2/download.html. If you use an earlier version of Java, such as Java 1.3.x, you also need an XML parser such as the Apache project's Xerces-Java (available at http://xml.apache.org/xerces2-j/index.html), or Sun's Java API for XML Parsing (JAXP), part of the Java Web Services Developer Pack (available at http://java.sun.com/webservices/downloads/webservicespack.html). You can also download the official version from SourceForge (available at http://sourceforge.net/project/showfiles.php?group_id=29449).
- Other Languages: If you wish to adapt the examples, SAX implementations are also available in other programming languages. You can find information on C, C++, Visual Basic, Perl, and Python implementations of a SAX parser at http://www.saxproject.org/?selected=langs.
Duration
Under one hour
Formats html, pdf
|  | |  |