Validate Your Feed


The most basic of the best practices is to make sure you validate your feed before publishing it, using a feed validator like the one at www.feedvalidator.org (Figure 10.1).

Figure 10.1. Use a feed validator before publishing your feed.


Yes, validating your feed is a pain. But if you want to publish a smooth feed that readers can count on, this step is essential. People can't read an invalid feed. Even if you use an RSS feed-creation editor, you should still validate your feedsat least until you're certain that your editor is producing flawless RSS as it should.

Spotting validation problems isn't easy if you're trying to do it by eye. Can you spot the validation error in this otherwise flawless RSS document?

    <?xml version="1.0"?>    <!DOCTYPE rss SYSTEM      "http://my.netscape.com/publish/formats/rss-0.91.dtd">    <rss version="0.91">      <channel>        <copyright>Copyright 2005.</copyright>        <pubDate>Wed, 14 Dec 2005 07:00:00 GMT</pubDate>        <lastBuildDate>Mon, 12 Dec 2005 07:00:00 GMT</lastBuildDate>        <docs>http://www.rssmaniac.com/steve/info.html</docs>        <description>This feed contains news from Steve!</description>        <link>http://www.rssmaniac.com/steve</link>        <title>Steve's News!</title>        <language>en-us</language>        <image>          <title>Steve's News</title>          <url>http://www.rssmaniac.com/steve/Image.jpg</url>          <link>http://www.rssmaniac.com/steve</link>          <description>Steve's News</description>          <width>144</width>          <height>36</height>        </image>        <managingEditor>steve@rssmaniac.com (Steve)</managingEditor>        <webMaster>steve@rssmaniac.com (Steve)</webMaster>        <skipHours>          <hour>8</hour>          <hour>9</hour>          <hour>10</hour>        </skipHours>        <skipDays>          <day>Sunday</day>        </skipDays>        <item>          <title>Steve shovels the snow</title>          <description>It snowed once again.           Time to shovel!>          </discription>          <link>http://www.rssmaniac.com/steve</link>        </item>        <textinput>          <title>Search for other items</title>          <description>What do you want to find?</description>          <name>search</name>          <link>http://www.rssmaniac.com/find.php</link>        </textinput>      </channel>    </rss> 


An RSS validator can immediately pick out the problem for you. In this case it'll tell you that the item's closing </description> tag has been misspelled as </discription> (Figure 10.2).

Figure 10.2. The RSS feed validator finds a problem.


To validate your RSS feed after it's online, just pass your feed's URL to a feed validator.



Secrets of RSS
Secrets of RSS
ISBN: 0321426223
EAN: 2147483647
Year: 2004
Pages: 110

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net