The feed "container" is information about the overall site that provides the feed, consisting of several fields that are listed once for the entire feed. Included within this container are the following fields that repeat across most syndication feeds:
(Note that these aren't all the elements for each fieldjust those that are required and the most commonly occurring optional elements.) Let's see some examples of feeds. The following is the head section of an Atom feed from O'Reilly's Radar weblog: <feed xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="0.3" xml:lang="en"> <title>O'Reilly Radar</title> <link rel="alternate" type="text/html" href="http://radar.oreilly.com/" /> <modified>2005-10-13T17:13:35Z</modified> <tagline>http://radar.oreilly.com/</tagline> <id>tag:radar.oreilly.com,2005://24</id> <generator url="http://www.movabletype.org/" version="3.2">Movable Type </generator> <copyright>Copyright (c) 2005, O'Reilly Media, Inc.</copyright> <link rel="start" href="http://feeds.feedburner.com/oreilly/radar/atom" type="application/atom+xml" /> ... </feed> In the example, notice the modified date, title, and copyright notice. Here the field link identifies the feed's relationship with the document. A RSS 1.0 feed from the same site looks like: <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:cc="http://web.resource.org/cc/" xmlns="http://purl.org/rss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"> <channel rdf:about="http://radar.oreilly.com/"> <title>O'Reilly Radar</title> <link>http://radar.oreilly.com/</link> <description>http://radar.oreilly.com/</description> <dc:creator /> <dc:date>2005-10-13T08:47:28-08:00</dc:date> <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=3.2" /> <cc:license rdf:resource="http://creativecommons.org/licenses/by-nc-sa/1.0/" /> ... </rdf:RDF> Notice that the first XML element is the main rdf:RDF, required for all RDF/ XML documents. Other than that, it is very similar to the Atom feed, other than some name differences and changes in the namespaces (the acronym identifiers that are located at the beginning of the document and are used to point to the schema where the elements arise). There is one major difference between RSS 1.0 and the other syndication feeds, and that is that all the items included in RSS 1.0 feeds are first listed in a container- like element, and are then defined in full in other parts of the document. This container looks as follows: <items> <rdf:Seq> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/re_sensible_ email_messages.html" /> <rdf:li rdf:resource="http://webkit.opendarwin.org/" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/bitkeeper_v_ everyone.html" /> <rdf:li rdf:resource="http://www.peatsbooks.com/books" /> <rdf:li rdf:resource="http://www.engadget.com/entry/1234000207062697/" /> <rdf:li rdf:resource="http://docs.yahoo.com/docs/pr/release1265.html" /> <rdf:li rdf:resource="http://querybyhum.cs.nyu.edu/" /> <rdf:li rdf:resource="http://www.tablesturned.com/" /> <rdf:li rdf:resource="http://news.com.com/Palm%20drops%20Zire%2C%20Tungsten% 20names/2100-1041_3-5893455.html" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/yahoo_ research_berkeley_launch.html" /> <rdf:li rdf:resource="http://www.dailykos.com/ storyonly/2005/10/11/154544/44" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/eurooscon_ maker_faire_lineup.html" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/google_maps_ and_their_data_pro_1.html" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/your_money_ or_your_mysql_1.html" /> <rdf:li rdf:resource="http://radar.oreilly.com/archives/2005/10/skype_phone_ from_linksys.html" /> </rdf:Seq> </items> O'Reilly Radar doesn't have an RSS 2.0 feed (discussed later in this article), so I pulled a sample from the Scripting News weblog of Dave Winer. Dave is the creator of RSS 2.0, a sample of which follows: <rss version="2.0"> <channel> <title>Scripting News</title> <link>http://www.scripting.com/</link> <description>It's even worse than it appears.</description> <language>en-us</language> <copyright>Copyright 1997-2005 Dave Winer</copyright> <pubDate>Thu, 13 Oct 2005 04:00:00 GMT</pubDate> <lastBuildDate>Thu, 13 Oct 2005 15:42:37 GMT</lastBuildDate> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <generator>UserLand Frontier v9.0.1</generator> <managingEditor>dwiner@cyber.law.harvard.edu</managingEditor> <webMaster>dwiner@cyber.law.harvard.edu</webMaster> ... </channel> </rss> The use of namespaces in RSS 2.0 is fairly rare, but has become more common as other companies such as Microsoft and Apple have added discussion, something else discussed later in the article. These are examples of the feed's head section. What goes into the entry sections is discussed later, with examples for entries included. Note: Syndication feeds are created automatically using various tools, usually built into whatever tool you're using to create your website. These examples are provided purely for reference purposes, not as a guide in how to create a feed. |