Introduction to Atom
This document introduces the Atom Syndication Format, an XML-based standard for web content and metadata syndication, akin to a structured news feed for the internet. It details the precise XML structure, required and optional elements for both feeds and individual entries, and common constructs for rich media. Hacker News readers appreciate deep dives into fundamental web standards, particularly those that enable structured data and content distribution across the web.
The Lowdown
Atom is an XML-based format for Web content and metadata syndication, as well as an application-level protocol for publishing and editing resources on frequently updated websites. This document, based on the IETF AtomPub Working Group's specification (RFC 4287), serves as a foundational guide. It mandates that all Atom feeds be well-formed XML documents identified by the application/atom+xml media type.
- Core Principles: All Atom elements must reside in the
http://www.w3.org/2005/Atomnamespace, timestamps must conform to RFC 3339, and element values are typically plain text unless otherwise specified. It also leveragesxml:langfor language identification andxml:basefor resolving relative URIs. - Feed Structure: An Atom feed is composed of metadata about the feed itself, followed by any number of entries. Required feed elements include a globally unique and permanent
id, a human-readabletitle, and anupdatedtimestamp. Recommended elements areauthor(or within entries) and alink(especiallyrel="self"). Optional elements spancategory,contributor,generator,icon,logo,rights, andsubtitle. - Entry Structure: Each entry represents a distinct piece of content, such as a blog post. Required entry elements are a unique
id, atitle, and anupdatedtimestamp. Recommended elements includeauthor(or inherited),content(inline or linked),link(analternatelink if no content), and asummary. Optional elements provide further detail, such ascategory,contributor,published,rights, andsource(for copied entries). - Common Constructs: The document defines several reusable constructs:
- Category: Uses a
termfor identification, with optionalscheme(categorization URI) andlabel. - Content: Highly flexible, it can contain inline text (plain, HTML, XHTML), link to external content via a
srcattribute, or embed XML or base64 encoded data based on itstypeattribute. - Link: Modeled after HTML's link element, it uses
hreffor the resource URI andrelto define the relationship (e.g.,alternate,enclosure,self). Other attributes includetype,hreflang,title, andlength. - Person: Used by
authorandcontributor, detailing aname, optionaluri(homepage), andemail. - Text: For elements like
title,summary,content, andrights, thetypeattribute specifies encoding (e.g.,textfor plain text,htmlfor entity-escaped HTML,xhtmlfor inline XHTML).
- Category: Uses a
- Extensibility: Atom is designed to be extensible, allowing for the direct inclusion of other XML vocabularies within the
contentelement and the use of elements from different namespaces, ensuring compatibility with many RSS modules.
This introduction provides a comprehensive overview of the Atom Syndication Format, making it an essential reference for developers and content publishers aiming to implement or understand this enduring web standard for content distribution.