Developer Forums | About Us | Site Map


Useful Lists

Web Host
site hosted by netplex

Online Manuals

An introduction to RSS news feeds
By James Lewin - 2004-04-05 Page:  1 2 3 4 5 6

Creating RSS files

You can build RSS files to either the proposed RSS 1.0 specification, or to the currently more popular RSS 0.91 spec. For production applications, use RSS 0.91, because the 1.0 proposal is still under consideration. The Resources section, at bottom, includes links to both the 1.0 and 0.91 specs. which provide a detailed review of all elements. This discussion focuses on the most commonly used elements, and all the examples in this article are in 0.91 format.

The 1.0 proposal differs from the 0.91 format in one main way: It incorporates Resource Description Framework (RDF) elements that allow greater flexibility at the expense of some increased complexity. This proposed specification is more extensible, creating a W3C standard for RSS files that will meet current needs, will be as backwards-compatible as possible, and will be adaptable to future requirements.

Both versions of the specification share the characteristic of being a lightweight format that developers can use for many purposes.

RSS is an XML application. Because of this, all RSS documents begin with the XML 1.0 declaration followed by the RSS document type declaration, as shown in Listing 2.

<?xml version="1.0"?>

<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN"
<rss version="0.91">

The first line declares the document to be an XML document. The second line, the DTD declaration, specifies that this XML file is based on the RSS 0.91 document type definition, DTD, at Netscape. Finally, the root element marks the beginning of the RSS file content, all of which goes between the <rss version "0.91"> tag and the </rss> tag.

View An introduction to RSS news feeds Discussion

Page:  1 2 3 4 5 6 Next Page: The four main sections of an RSS file

First published by IBM developerWorks

Copyright 2004-2019 All rights reserved.
Article copyright and all rights retained by the author.