Starting an RSS Feed

An RSS feed is an XML document and as such must conform with XML syntax (see page 38). Over the next few pages, I'll show you how to write the whole thing with just a text editor. While you can create syndication feeds in several formats, RSS 2.0 is perhaps the most widespread and the most versatile. It's what we'll use in this chapter.

Figure 25.4. An RSS feed is an XML document. This means it must start with an XML declaration and then the <rss> root element. The syntax is persnickety but not particularly complex.

To start an RSS feed:


Open a new text document with any text editor.


At the top, begin the XML declaration by typing: <?xml version="1.0"


Next, declare the character encoding as utf-8 by typing encoding="UTF-8".


Complete the xml declaration with ?>.


Next, declare that you're using RSS 2.0 by typing <rss version="2.0">.


To begin the information about your site, type <channel>.


Leave a few spaces for the rest of the feed (which you'll complete in the rest of this chapter) and then close the channel and rss elements by typing </channel> </rss>.


Save the document as text only with the .xml extension. Make sure you encode it in UTF-8. (See page 333 for details.)

RSS Feed Generators

There are tools that facilitate creating RSS feeds but it's a little bit like using an accountant to do your taxes. If you hire an accountant, her job is to ask you questions about your last year's earnings, but the task of assembling that information still stays with you. Feed writers (like Feeder, are similar. They provide dialog boxes where you enter the data and then they assemble the feed in the proper format for you. You have to weigh whether the cost and learning curve associated with such programs, as well as the loss of absolute control over the output is worth the automation that they provide.

And you can always do what I do: hire an accountant and tweak the results.


  • While the UTF-8 encoding is not required for all aggregators, it is required for some (iTunes among them), and is the norm.

  • RSS is case sensitive. <channel> is not the same as <Channel>. Follow the examples closely.

HTML, XHTML, & CSS(c) Visual QuickStart Guide
HTML, XHTML, and CSS, Sixth Edition
ISBN: 0321430840
EAN: 2147483647
Year: 2004
Pages: 340

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: