Introduction
RSS (Really Simple Syndication) is a web content syndication format: a site publishes an XML file listing its latest items, and feed readers fetch it. The
specification described here is RSS 2.0, version 2.0.11 of 30 March 2009, kept by the RSS Advisory Board. The specification
says the format is, for practical purposes, frozen: new work belongs in namespaced modules. A feed is served as application/rss+xml
(the specification text read for this site does not name a media type) and is often called rss.xml, feed.xml or feed, or .rss.
Structure
All RSS files must be well-formed XML 1.0. At the top is an <rss> element with a mandatory version attribute, which must be 2.0
for a file that conforms to this specification. Inside it is a single <channel>.
<rss version="2.0">
<channel>
<title>GoUpstate.com News Headlines</title>
<link>http://www.goupstate.com/</link>
<description>The latest news from GoUpstate.com.</description>
<item>
<title>Venice Film Festival Tries to Quit Sinking</title>
<link>http://nytimes.com/2004/12/07FEST.html</link>
<pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate>
<guid>http://some.server.com/weblogItem3207</guid>
</item>
</channel>
</rss>
| Element | Rule (RSS 2.0) |
|---|---|
channel: title, link, description | Required. The name of the channel, the URL of the corresponding website, a phrase or sentence describing it. |
| channel, optional | language, copyright, managingEditor, webMaster, pubDate, lastBuildDate, category, generator, docs, cloud, ttl (a number of minutes), image, rating, textInput, skipHours (up to 24 hours, 0 to 23, GMT), skipDays (up to seven days, Monday to Sunday). |
channel image | Three required sub-elements, url, title, link; optional width (maximum 144, default 88), height (maximum 400, default 31) and description. A GIF, JPEG or PNG. |
channel textInput | Four required sub-elements: title, description, name, link. |
item | Any number. All elements are optional, “however at least one of title or description must be present”. Elements: title, link, description, author (an email address), category (optional domain), comments (a URL), enclosure, guid, pubDate, source. |
enclosure | Three required attributes: url (must be an http url), length (bytes) and type (a MIME type). |
guid | A string that uniquely identifies the item; no syntax rules. Optional attribute isPermaLink (default true). |
source | The channel the item came from; one required attribute, url. |
| Dates | All date-times conform to RFC 822, except that the year may have two or four characters (four preferred): Sat, 07 Sep 2002 09:42:31 GMT. |
| Links | The data in link and url elements must begin with an IANA-registered URI scheme (http://, https://, news://, mailto:, ftp:…). |
| Extending | A feed may contain elements and attributes not described only if they are defined in a namespace. The 0.91 limits (500 or 100 characters, 15 items) do not apply to 0.92 and later. |
In the explorer
A file with the extension .rss opens here, and so does an .xml file whose root element is <rss> with a version attribute.
Every other .xml file, including one whose root is <rss> with no version, opens as XML exactly as it did before. The view is the XML tree
with an Items tab (title, link, date and guid of each item) and a Problems tab. The rules above are checked and each failure is a problem quoted from the
specification: a missing version or channel element, an item with neither title nor description, a date that is not RFC 822, a link with no URI scheme, an
enclosure missing an attribute, a repeated guid, an image over the size limits, a non-namespaced element the specification does not describe. An https
enclosure is noted, because the specification text says the url must be an http url although feeds use https today. Nothing is fetched.
Not described
Known, not yet covered
- Reference: RSS 0.91, 0.92 and 1.0 (the RDF-based one) are not described; a 0.9x file with the rss element is read by the 2.0 rules, which the specification says a 0.91 or 0.92 file also satisfies.
- Reference: the common modules (Dublin Core, content:encoded, iTunes podcast tags, Media RSS) are shown in the tree but their elements are not described.
- Viewer: the RFC 822 date check is a shape test (day, month name, year, time, zone), not a calendar check; email addresses in
author,managingEditorandwebMasterare not checked;cloudattributes andcategorypaths are not checked.
Unknown
- Reference: the media type: the specification text read does not state it.
Links
Reference
- RSS 2.0 Specification – the RSS Advisory Board’s text
- RSS Profile – the Board’s recommendations for feeds that work best in readers