HTML and CSS Reference
In-Depth Information
RSS has the following versions: RSS 0.90, RSS 0.91, RSS 0.92, and RSS 2.0. In 2000, the name
RDF Site Summary
was in use, which referred to the extensibility with RDF-based modularization [7]. Version 0.91 was called
Rich Site
Summary
, which dropped the RDF structure and imported elements from the scriptingNews syndication format
developed by Dave Winer for his news site “Scripting News.” The current acronym is
Really Simple Syndication
. The
latest version of the RSS Specification has a permanent URI at the RSS Advisory Board web site [8]. The most widely
used and most advanced version, RSS 2.0.11 [9], is discussed in the next sections.
Creating an RSS File
To create an RSS file, you first need an XML declaration and an
rss
element. The
rss
element is the root element
of RSS files and is the container of a
channel
element, which provides information about the file and contains
item
elements (news feed entries). Listing 8-1 shows the general structure of an RSS file. The
version
attribute on the
rss
element is required, and its value must be
2.0
for RSS 2.0.11 (without indicating the subversion).
Listing 8-1.
General Structure of an RSS File with Maximized Interoperability
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0"
xmlns:content="
http://purl.org/rss/1.0/modules/content/
"
xmlns:dc="
http://purl.org/dc/elements/1.1/
"
xmlns:sy="
http://purl.org/rss/1.0/modules/syndication/
"
xmlns:atom="
http://www.w3.org/2005/Atom
"
>
<channel>
<title>An RSS news feed example</title>
<link>http://www.example.com</link>
<pubDate>Mon, 08 Aug 2011 08:03:00 +0200</pubDate>
<image>
<url>http://www.example.com/images/logo.png</url>
<title>An RSS news feed example</title>
<link>http://www.example.com</link>
</image>
<dc:creator>John Smith</dc:creator>
<description>The news feed of rock star John Smith. Concerts, CDs, and more.</description>
<language>en</language>
<sy:updatePeriod>daily</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<atom:link href="http://www.example.com/rss.xml" rel="self" type="application/rss+xml" />
<item>
<title>News item 2</title>
<link>http://www.news2link.com</link>
<pubDate>Mon, 08 Aug 2011 08:03:00 +0200</pubDate>
<dc:creator>John Smith</dc:creator>
<category>CDs</category>
<guid>http://www.news2link.com</guid>
<description>Description of news item 2</description>
<content:encoded>The full content of News #2.</content:encoded>
</item>
Search WWH ::
Custom Search