Before you start
Learn what to expect from this tutorial, and how to get the most out of it.
This tutorial provides a step-by-step look at how to process Atom 1.0 with XSLT. Atom is an important format for conveying information about Web sites that are organized into episodic content in some way. This might be Weblogs where new entries are published from time to time, event listings, multi-media programs and schedules, and much more. The breadth of Atom's domain is illustrated in the following description on the home page:
Atom is the name of an XML-based Web content and metadata syndication format, and an application-level protocol for publishing and editing Web resources belonging to periodically updated websites.
All Atom feeds must be well-formed XML documents, and are identified with the application/atom+xml media type.
Since well-formedness is of paramount importance in Atom, XSLT is a processing technology that comes quickly to mind. XSLT is a domain-specific language for transforming XML from one format to another, or to text or HTML for presentation. XSLT transforms are an effective cross-platform and cross-language means of processing Atom. This tutorial provides the building blocks for such processing.
This tutorial shows you how to navigate the basic structure of Atom 1.0 documents using XPath expressions, how to use these expressions to drive XSLT transformations of Atom source files, and how to deal with the complications of text and markup embedded in Atom files. You will also learn how to use XSLT templates to generate valid Atom files, and how to check the validity of the results.
This tutorial is written for developers who are familiar with XML, XPath, and XSLT. You should have some familiarity with XHTML and Atom, although the latter is a simple format that you can probably get a good grasp of by looking at the examples early on in this tutorial. See Resources for articles and tutorials that cover these topics. Some of the examples in this tutorial are taken from the background article on Atom 1.0 found in Resources.
To run the examples in this tutorial, you need an XSLT processor, preferably one that supports EXSLT (see Resources). I use 4Suite XML 1.0b2. You should also have a recently released Web browser version. When displaying browser output examples, I show screenshots of Firefox 1.0.7 on Fedora Core 4 Linux. Firefox is a popular Web browser available on Windows, Mac OS X, Linux, and other platforms. (Firefox 1.5 is now out, and I strongly encourage you to use that version.)