Declaring
XML
You have to realize that RSS is a type of XML file, so the
first thing you have to do is declare it as an XML file.
You do this by writing:
Declaring RSS
The next thing you have to define is the RSS format and version.
The version this tutorial will teach is the latest version
which is out right now, 2.0. So to define RSS, type:
<?xml version="1.0"
?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
</rss>
|
Declaring Channel
The next and final thing you have to delcare is the Channel.
The Channel is a subordinate of RSS which contains all
the date for the RSS file. Your code should now look like:
<?xml version="1.0"
?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
<channel>
</channel>
</rss>
|
Declaring Miscellaneous Information
There are some optional elements which you can insert into
your RSS page. They're sort of obvious when you read the
tags, just replace the inside tag with your information:
<?xml version="1.0"
?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
<channel>
<title>Spoono Grapevine</title>
<link>http://www.spoono.com/</link>
<description>News and updates about design
and programming.</description>
<language>en-us</language>
<copyright>Copyright 1999-2003 Spoono LLC</copyright>
<lastBuildDate>Mon, 30 Sep 2002 11:00:00 GMT</lastBuildDate>
<docs>http://backend.userland.com/rss</docs>
<managingEditor>webmaster@spoono.com</managingEditor>
<webMaster>webmaster@spoono.com</webMaster>
<ttl>60</ttl>
</channel>
</rss>
|
The Actual List
The final step in all of this is to finally list the news
post or the main content you have to display. You can do
this simply. Each post is called an "item". Inside
the item tags are the "title", "author",
and
"description" tags which you have to define. Just
keep defining it for each list item you have. Also, a personal
preference of mine is to put the description stuff inside
CDATA so it doesn't get parsed by XML. Look at the bolded
code, it shows 2 different lists.
<?xml version="1.0"
?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
<channel>
<title>Spoono Grapevine</title>
<link>http://www.spoono.com/</link>
<description>News and updates about design
and programming.</description>
<language>en-us</language>
<copyright>Copyright 1999-2003 Spoono LLC</copyright>
<lastBuildDate>Mon, 30 Sep 2002 11:00:00 GMT</lastBuildDate>
<docs>http://backend.userland.com/rss</docs>
<managingEditor>webmaster@spoono.com</managingEditor>
<webMaster>webmaster@spoono.com</webMaster>
<ttl>60</ttl>
<item>
<title>Some New v4 Info</title>
<author>Brian</author>
<description>
<![CDATA[ Welcome to Spoono v4! To get you better
acqainted with the site, please read our big news
post in the Spoono Tap area. Right now, v4 is still
full of quite a few bugs, which we hope to iron out
in the next couple weeks. Please contact us if you
find anything that seems the least bit odd. If Spoono
appears in a strange color one day, no need to fear
(We meant to do that. You can choose from 7 different
colors in the Flavors area). We still have a lot
of content to get up. So, we should be adding a whole
lot of tutorials in the next few weeks.
]]>
<item>
<title>Some New v4 Info</title>
<author>Brian</author>
<description>
<![CDATA[ Welcome to Spoono v4! To get you better
acqainted with the site, please read our big news
post in the Spoono Tap area. Right now, v4 is still
full of quite a few bugs, which we hope to iron out
in the next couple weeks. Please contact us if you
find anything that seems the least bit odd. If Spoono
appears in a strange color one day, no need to fear
(We meant to do that. You can choose from 7 different
colors in the Flavors area). We still have a lot
of content to get up. So, we should be adding a whole
lot of tutorials in the next few weeks.
]]>
</description>
</item>
</channel>
</rss>
|
Conclusion
That is the final step, and voila you're finished. It's not
too complicated and pretty easy to write the code for.
Try it out, and if you have any questions, post and we'll
reply.
|