Container Elements


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:


link

This is the link for the site's URL, such as the weblog's URL.


title

This is the title for the site, such as the weblog's title.


description

This is a description of the weblog or site, and usually contains whatever subtitle is given for the site. In Atom, this is the subtitle field.


author

In Atom, author is a structure containing the author's name and email, or just the author's email. In RSS 2.0, this field is replaced by webMaster and managingEditor, which are email addresses. In RSS 1.x, this is replaced, usually, by dc:creator (which may be either a structure or a simple value).


date

In RSS 1.x, this field, usually dc:date, is the date the feed was updated. In Atom, this is the updated field; in RSS 2.0, this is the lastBuildDate.


generator

In RSS 2.0, this is the tool used to generate the syndication feed. The Atom feed also uses generator, while RSS 1.x uses generatorAgent.


copyright

Copyright information.


language

What language the text of the document is in.


id

This field is specific to Atom, and provides a unique identifier for the site.


image

An icon or image representing the feed or site for both RSS 1.x and RSS 2.x. In Atom, this would be icon, though logo can be used for a logo representation. In RSS 1.1 and RSS 2.0, image is a structure pointing to the image's URL, title, and link to site. In RSS 1.x, the image should be 88x31. In Atom, the icon "should have an aspect ratio of one (horizontal) to one (vertical), and should be suitable for presentation at a small size." In RSS 2.0, the image should have a maximum width of 144, and maximum height of 400; default is 88x31.

(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.



What Are Syndication Feeds
What Are Syndication Feeds
ISBN: 321490452
EAN: N/A
Year: 2005
Pages: 19

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net