# XML - Managing Data Exchange/RSS

![](Feed-icon.svg "Feed-icon.svg")

## Learning Objectives

Upon completion of this chapter, you will

-   Understand the basics of RSS
-   Understand the history of RSS
-   Be able to construct a RSS 2.0 document using XML
-   Subscribe to an RSS aggregator/reader

## Introduction

RSS is a simple XML format used to syndicate headlines. It is now
popularly used by websites that publish new content regularly and
provide a list of headlines with links to their latest content. Content
such as news feeds, events listings, project updates, blogger and most
recently podcasting, video and image distribution can all be distributed
by RSS. RSS feeds are also used by major Internet portals such as
Google, Yahoo and AOL for people to personalize and have information
that they care about delivered to them, i.e. MyYahoo.

### What does RSS mean?

RSS is considered a name variously used to refer to three different
standards. The three separate branches are the RSS 0.9 branch, the RSS
1.0 branch (which is based on RDF) and RSS 2.0, and the initials have
been expanded into three different names: \"Really Simple Syndication\"
(RSS 0.9, 2.0), \"Rich Site Summary\" and \"RDF Site Summary\" (for RSS
1.0).

Several different versions have been developed by different developers
under different names. According to XML.com, seven versions of RSS have
been developed (see What is
RSS?). Because
RSS is understood as a term referring to many types of syndication
protocols, these various RSS protocols have sometimes been accused of
being \"incompatible\" with each other (see The myth of RSS
compatibility).
This is an important issue for RSS reader/aggregator developers.\

### History

The original version (version 0.90) of RSS was released by Netscape in
1999. Netscape developers were designing a format for making portals of
headlines for news sites. After Netscape released the simplified version
of RSS, they lost interest in developing RSS. However, another company,
UserLand Software took over with intention to use RSS with their
web-logging products and web-based writing software. While UserLand
Software continued development with version 0.91, a third non-commercial
group split off from the company and designed a new format based on
version 0.90, which was a non-simplified version. The new format
developed by this non-commercial group became known as version 1.0. In
the meantime UserLand Software grew angered at the new 1.0 version, kept
developing RSS and released version 2.0. Version 2.0 has become the
leader and most widely adopted version of RSS. The 2.0 specification was
donated to a non-commercial third party, Harvard Law School. Harvard Law
is now responsible for the future development of the RSS 2.0
specification. Below is a table that describes each version, the owner,
pros and cons, as well as its current status and recommendation for use.

```{=html}
<table border="1" summary="RSS versions and recommendations of use">
```
```{=html}
<caption>
```
RSS versions and recommendations, Table source: What is
RSS? XML.com

```{=html}
</caption>
```
```{=html}
<tr>
```
```{=html}
<th>
```
Version

```{=html}
</th>
```
```{=html}
<th>
```
Owner

```{=html}
</th>
```
```{=html}
<th>
```
Pros

```{=html}
</th>
```
```{=html}
<th>
```
Status

```{=html}
</th>
```
```{=html}
<th>
```
Recommendation

```{=html}
</th>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<th>
```
0.90

```{=html}
</th>
```
```{=html}
<td>
```
Netscape

```{=html}
</td>
```
```{=html}
<td>
```
 

```{=html}
</td>
```
```{=html}
<td>
```
Obsoleted by 1.0

```{=html}
</td>
```
```{=html}
<td>
```
Don\'t use

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<th>
```
0.91

```{=html}
</th>
```
```{=html}
<td>
```
UserLand

```{=html}
</td>
```
```{=html}
<td>
```
Drop dead simple

```{=html}
</td>
```
```{=html}
<td>
```
Officially obsoleted by 2.0, but still quite popular

```{=html}
</td>
```
```{=html}
<td>
```
Use for basic syndication. Easy migration path to 2.0 if you need more
flexibility

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<th>
```
0.92, 0.93, 0.94

```{=html}
</th>
```
```{=html}
<td>
```
UserLand

```{=html}
</td>
```
```{=html}
<td>
```
Allows richer metadata than 0.91

```{=html}
</td>
```
```{=html}
<td>
```
Obsoleted by 2.0

```{=html}
</td>
```
```{=html}
<td>
```
Use 2.0 instead

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<th>
```
1.0

```{=html}
</th>
```
```{=html}
<td>
```
RSS-DEV Working Group

```{=html}
</td>
```
```{=html}
<td>
```
RDF-based, extensibility via modules, not controlled by a single vendor

```{=html}
</td>
```
```{=html}
<td>
```
Stable core, active module development

```{=html}
</td>
```
```{=html}
<td>
```
Use for RDF-based applications or if you need advanced RDF-specific
modules

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<th>
```
2.0

```{=html}
</th>
```
```{=html}
<td>
```
UserLand

```{=html}
</td>
```
```{=html}
<td>
```
Extensibility via modules, easy migration path from 0.9x branch

```{=html}
</td>
```
```{=html}
<td>
```
Stable core, active module development

```{=html}
</td>
```
```{=html}
<td>
```
Use for general-purpose, metadata-rich syndication

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
## RSS structure

A RSS document is often known as RSS feed and can have three different
types of file extensions: .RSS, .XML and .RDF. All RSS documents must
conform 100% to the XML specification begin with the XML declaration. To
identify a RSS document, the top level starts with a
`<span style="color:Red;">`{=html}`<rss>`{=html}`</span>`{=html}
element, followed by a mandatory version attribute that specifies the
RSS version. Sub-element to the
`<span style="color:Red;">`{=html}`<rss>`{=html}`</span>`{=html}
element, is the single
`<span style="color:Red;">`{=html}`<channel>`{=html}`</span>`{=html}
element which contains a brief description of the channel. Below is a
sample of RSS(2.0) from the New York Times.\
**Exhibit 1: Data model for RSS**

``` XML
<rss version="2.0">
    <channel>
        <title>NYT > Home Page</title>
        <link> <nowiki>http    //www.nytimes.com/index.html</nowiki> </link>
        <description>New York Times > Breaking News, World News Multimedia</description>
        <copyright>Copyright 2004 The New York Times Company</copyright>
        <language>en-us</language>
        <lastBuildDate>Sun,  7 Nov 2004 13    30    01 EST</lastBuildDate>
        <image>
            <url> <nowiki>http    //www.nytimes.com/images/section/NytSectionHeader.gif</nowiki> </url>
            <title>NYT > Home Page</title>
            <link> <nowiki>http    //www.nytimes.com/index.html</nowiki> </link>
        </image>
        <item>
            <title>Iraq Declares State of Emergency as Insurgents Step Up Attacks</title>
            <link> <nowiki>http    //www.nytimes.com/2004/11/07/international/middleeast/07cnd-iraq.html</nowiki> </link>
            <description> Today's attacks, including three police post raids that killed 21, came a day after insurgents killed at least 30. </description>
            <author> By EDWARD WONG </author>
            <pubDate> Sun, 07 Nov 2004 00    00    00 EDT </pubDate>
            <guid> <nowiki>http    //www.nytimes.com/2004/11/07/international/middleeast/07cnd-iraq.html</nowiki> </guid>
        </item>
    </channel>
</rss>
```

`<small>`{=html}**Figure 1-1: New York Times -
HomePage.xml -
RSS version 2** `</small>`{=html}\
\
The `<span style="color:Red;">`{=html}`<channel>`{=html}`</span>`{=html}
element has three mandatory elements and several optional elements.\
**Mandatory `<channel>`{=html} elements:**

```{=html}
<table width="100%" border="1" cellspacing="0" cellpadding="0">
```
```{=html}
<tr>
```
```{=html}
<td>
```
Element

```{=html}
</td>
```
```{=html}
<td>
```
Description

```{=html}
</td>
```
```{=html}
<td>
```
Example

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
```{=html}
<title>
```
```{=html}
</td>
```
```{=html}
<td>
```
Name of the channel

```{=html}
</td>
```
```{=html}
<td>
```
\"The New York Times\"

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<description>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Brief description of the channel

```{=html}
</td>
```
```{=html}
<td>
```
New York Times \> Breaking News, World News Multimedia

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<link>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
URL to the channel associated website

```{=html}
</td>
```
```{=html}
<td>
```
http://www.nytimes.com/index.html

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
\
**Optional `<channel>`{=html} elements:**

```{=html}
<table width="100%" border="1" cellspacing="0" cellpadding="0">
```
```{=html}
<tr>
```
```{=html}
<td>
```
Element

```{=html}
</td>
```
```{=html}
<td>
```
Description

```{=html}
</td>
```
```{=html}
<td>
```
Example

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<language>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Channel language

```{=html}
</td>
```
```{=html}
<td>
```
en-us

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<copyright>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Copyright notice for content in the channel

```{=html}
</td>
```
```{=html}
<td>
```
Copyright 2004 The New York Times Company

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<lastBuildDate>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
The last time the content of the channel was updated/changed

```{=html}
</td>
```
```{=html}
<td>
```
Sun, 7 Nov 2004 13:30:01 EST

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
\
Other optional elements include: managingEditor, webMaster, pubDate,
category, generator, docs, cloud, ttl, image, rating, textInput,
skipHours, skipDates. The requirement or sub-elements of each element
please refer to the RSS specification.(see at Harvard
Law).
Below are example of image element.\
\
`<image>`{=html} elements:\

```{=html}
<table width="100%" border="1" cellspacing="0" cellpadding="0">
```
```{=html}
<tr>
```
```{=html}
<td>
```
Element

```{=html}
</td>
```
```{=html}
<td>
```
Description

```{=html}
</td>
```
```{=html}
<td>
```
Example

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<link>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
The URL to the item

```{=html}
</td>
```
```{=html}
<td>
```
http://www.nytimes.com/index.html

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
```{=html}
<title>
```
```{=html}
</td>
```
```{=html}
<td>
```
Picture title

```{=html}
</td>
```
```{=html}
<td>
```
NYT \> Home Page

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<url>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
The URL to the picture

```{=html}
</td>
```
```{=html}
<td>
```
http://www.nytimes.com/images/section/NytSectionHeader.gif

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
A channel may contain a number of `<item>`{=html}s. An item may
represent a \"story\" - much like a story in a newspaper or magazine; if
so, its description is a synopsis of the story. The link points to the
full story. An item may also be complete in itself, if so, the
description contains the text (entity-encoded HTML is allowed; see
examples), and the link and title may be omitted.\
Each RSS channel can contain up to 15 items. All elements of an item are
optional,however, an `<item>`{=html} element must contain at least one

```{=html}
<title>
```
or `<description>`{=html} element.\
\
`<item>`{=html} elements:\

```{=html}
<table width="100%" border="1" cellspacing="0" cellpadding="0">
```
```{=html}
<tr>
```
```{=html}
<td>
```
Element

```{=html}
</td>
```
```{=html}
<td>
```
Description

```{=html}
</td>
```
```{=html}
<td>
```
Example

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
```{=html}
<title>
```
```{=html}
</td>
```
```{=html}
<td>
```
Title of the item

```{=html}
</td>
```
```{=html}
<td>
```
Iraq Declares State of Emergency as Insurgents Step Up Attacks

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<link>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
The URL to the item

```{=html}
</td>
```
```{=html}
<td>
```
http://www.nytimes.com/2004/11/07/international/middleeast/07cnd-iraq.html

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<description>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Brief description of the item

```{=html}
</td>
```
```{=html}
<td>
```
Today\'s attacks, including three police post raids that killed 21, came
a day after insurgents killed at least 30.

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<author>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Author\'s name and/or author\'s email address

```{=html}
</td>
```
```{=html}
<td>
```
mail@nytimes.com (Edward Wong)

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<pubDate>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Date/time the item was published

```{=html}
</td>
```
```{=html}
<td>
```
Sun, 07 Nov 2004 00:00:00 EDT

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
<tr>
```
```{=html}
<td>
```
`<guid>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
Is a string that uniquely identifies the item. Can be used by the
aggregator to determine if an item is new.

```{=html}
</td>
```
```{=html}
<td>
```
http://www.nytimes.com/2004/11/07/international/middleeast/07cnd-iraq.html

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
Others include:\
source, enclosure, category, and comments.(see at Harvard
Law).\
\
An item can either be a child or a sibling of a channel.

```{=html}
<table width="100%" border="1" cellspacing="0" cellpadding="0">
```
```{=html}
<tr>
```
```{=html}
<td>
```
*\"child\"*

:   `<span style="color:Red;">`{=html}`<channel>`{=html}`</span>`{=html}

    :   \...
    :   `<span style="color:Blue;">`{=html}`<item>`{=html}`</span>`{=html}

        :   \.....
    :   `<span style="color:Blue;">`{=html}`</item>`{=html}`</span>`{=html}
:   `<span style="color:Red;">`{=html}`</channel>`{=html}`</span>`{=html}

```{=html}
</td>
```
```{=html}
<td>
```
*\"sibling\"*

:   `<span style="color:Red;">`{=html}`<channel>`{=html}`</span>`{=html}

    :   \...
:   `<span style="color:Red;">`{=html}`</channel>`{=html}`</span>`{=html}
:   `<span style="color:Red;">`{=html}`<item>`{=html}`</span>`{=html}

    :   \.....
:   `<span style="color:Red;">`{=html}`</item>`{=html}`</span>`{=html}

```{=html}
</td>
```
```{=html}
</tr>
```
```{=html}
</table>
```
More optional elements visit RSS 2.0
Specification

## How does it work?

RSS can be divided into two parts; the reader/ag and the feed. The
reader is the program that reads and presents the RSS feed in an
understandable format. The feed is the website with its RSS file. RSS
feeds are typically identified on webpages with an orange rectangle
icon, or an orange icon with the letters RSS written on it. To view the
XML code, you simply have to click on the icon.

### Creating an RSS feed

A website author can establish a RSS feed for itself in different ways;
either by doing it manually, by using software or by online services.
Most large websites use content management software to produce their RSS
feed. Every time a change is made on their website, the content
management software produce a RSS file of the changes with the new items
added and old items removed.

### Subscribing to an RSS feed

As a RSS subscriber you need a RSS aggregator. By feeding a RSS link,
the aggregator will search for information you subscribed and display
them. Say that you subscribe on the sport section in the New York Times;
each time the NY Times publish a new sport article the article's
headlines, description and the URL will be displayed on your computer.
Whenever you are online, the aggregator will search out and sort your
list of interests and display them.

### RSS Aggregators

RSS aggregator (aka RSS Reader) is an application that is used to
collect, update and display RSS feeds. Below is a list of some RSS
aggregators for different platforms that the aggregator will work
properly on.

-   FeedReader - Windows
-   Sharp
    Reader -
    Windows(.NET)
-   NetNewsWire - Macintosh
-   Straw - Linux
-   Bloglines - Server-based
-   NewsHutch - Server-Based

Some others include:

-   AmphetaDesk - Windows,
    Macintosh, Linux
-   FeedDemon - Windows
-   FeedReader - Windows
-   NewsGator - Windows(.NET)
-   RSS NewsWatcher - Windows
-   Radio Userland -
    Windows, Macintosh
-   SlashDock -
    Macintosh
-   PocketFeed -
    PocketPC

\

## Future of RSS

The future of RSS seems very promising as version 2.0 has become
extremely popular with the Internet industry and somewhat the standard
of the RSS versions. Yahoo recently released its new version of Yahoo
Maps and the API is based on georRSS version 2.0. This version of Yahoo
Maps allows users to edit the information on the maps, which makes the
Maps and Local Search products more effective. RSS version 2.0 is also
very popular with distributing podcasts to the subscriber base along
with distributing content Google's blogger product. Furthermore, RSS is
being utilized in an innovative way for search engine marketers to
submit time sensitive content to the engines. The Mozilla Firefox
browser already contains an internal RSS aggregator that allows users to
view RSS news and blog headlines in the bookmark toolbar or bookmark
menu. This is accomplished through the Mozilla Firefox feature named
"Live Bookmarks". RSS has quickly become a mainstream technology in a
relatively short period and has definitely become a major player in the
Internet space.

## Use RSS on Firefox

## Summary

  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  Now, RSS is commonly used in areas such as, websites and blogs, with version 2.0 being the most popular standard. RSS feeds are typically identified on webpages with an orange rectangle icon, or an orange icon with the letters RSS written on it. To view the XML code, you simply have to click on the icon.
  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Exercises

## Answers

## References

Technology at Harvard Law - Internet technology hosted by Berkman
Center - RSS 2.0 Specification\
Dive-into-XML by Mark Pilgrim - What is
RSS?\
Mozilla Firefox - Live
Bookmarks\
Apple - PodCasting\
RSS INFO - RSS info\
USA Today - USA Today\

