HN
Today

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.

10
Score
3
Comments
#9
Highest Rank
14h
on Front Page
First Seen
May 3, 11:00 PM
Last Seen
May 4, 12:00 PM
Rank Over Time
91112129141314141722252422

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/Atom namespace, timestamps must conform to RFC 3339, and element values are typically plain text unless otherwise specified. It also leverages xml:lang for language identification and xml:base for 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-readable title, and an updated timestamp. Recommended elements are author (or within entries) and a link (especially rel="self"). Optional elements span category, contributor, generator, icon, logo, rights, and subtitle.
  • Entry Structure: Each entry represents a distinct piece of content, such as a blog post. Required entry elements are a unique id, a title, and an updated timestamp. Recommended elements include author (or inherited), content (inline or linked), link (an alternate link if no content), and a summary. Optional elements provide further detail, such as category, contributor, published, rights, and source (for copied entries).
  • Common Constructs: The document defines several reusable constructs:
    • Category: Uses a term for identification, with optional scheme (categorization URI) and label.
    • Content: Highly flexible, it can contain inline text (plain, HTML, XHTML), link to external content via a src attribute, or embed XML or base64 encoded data based on its type attribute.
    • Link: Modeled after HTML's link element, it uses href for the resource URI and rel to define the relationship (e.g., alternate, enclosure, self). Other attributes include type, hreflang, title, and length.
    • Person: Used by author and contributor, detailing a name, optional uri (homepage), and email.
    • Text: For elements like title, summary, content, and rights, the type attribute specifies encoding (e.g., text for plain text, html for entity-escaped HTML, xhtml for inline XHTML).
  • Extensibility: Atom is designed to be extensible, allowing for the direct inclusion of other XML vocabularies within the content element 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.