HTML and CSS Reference
In-Depth Information
<item>
<title>News item 1</title>
<link>http://www.news1link.com</link>
<pubDate>Sun, 07 Aug 2011 08:48:00 +0200</pubDate>
<dc:creator>John Smith</dc:creator>
<category>Concerts</category>
<guid>http://www.news1link.com</guid>
<description>A bit more about news 1</description>
<content:encoded><![CDATA[ The full content of News #1. In CDATA sections,
<a href="http://examp.com">markup code</a> can also be included. ]]></content:encoded>
</item>
</channel>
</rss>
The above example is for demonstration only, real-life applications usually contain many more
item
elements.
■
theoretically, an rSS channel can contain an arbitrary number of items. however, some rSS readers (such as the
news feed reader gadget in Windows Vista and Windows 7) do not support rSS files larger than approximately 150Kb or
2,800 lines, which corresponds to approximately 7 months of daily news. it is recommended that you keep the file size
under this limit to maximize interoperability.
Tip
Some of the presented elements are required, while others are optional but highly recommended. First we'll
examine the required elements.
Required Elements
As shown in the previous section, the
rss
element contains the
channel
element with all its contents. The required
elements of the
channel
element in RSS 2.0 are
title
,
link
, and
description
.
The title Element
The
title
element represents the name of the channel. It often coincides with the title of the web site it is associated
with. Listing 8-2 shows an example.
Listing 8-2.
The Title of an RSS Channel
<title>John Smith Headlines</title>
The link Element
The
link
element is a URI representing the domain where the news feed is located. Listing 8-3 shows an example.
Listing 8-3.
A Link in RSS
<link>http://example.com/</link>
Search WWH ::
Custom Search