Home arrow XML arrow Page 2 - Building an RSS File

Required Elements - XML

In the previous article we discussed how to read an RSS file with PHP. In this article we will focus on the theoretical aspects of how to build an RSS file.

  1. Building an RSS File
  2. Required Elements
  3. Enhanced RSS Document Structure
  4. Aggregators
By: Jacques Noah
Rating: starstarstarstarstar / 8
February 13, 2007

print this article



Table 2.





The name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website.

mysite.com Tech News


The URL to the HTML website corresponding to the channel.



Phrase or sentence describing the channel.

The latest tech news from mysite.com.

Simple RSS Document Structure:

Let's look at an example of a "Simple"RSS Document:

<?xml version="1.0" ?>
<rss version="0.91">
    <title>RSS Tutorial </title>
    <description> The RSS Tutorial</description>

      <title>RSS Syndication </title>

      <title>Technology in Crisis??</title>
      <description>The problem with technology in Schools</description>



As you can see all RSS Documents start with a "<?xml version?>" tag and end with a "</rss>" tag. This is also where you include the encoding type of the document. Without the <rss> tags, this will just be a bog standard, XML document. Immediately after the opening RSS tag, the channel is opened by the <channel> tag, after which a title, link and a description of your channel content is given. All of the elements are required; if even one of these elements is missing, your document will not pass a validator's test and most RSS readers will not be able to parse your content. Table 2 describes the three individual tags that comes immediately after the opening channel tag.

Now the <item> tags are at the heart of the document. They contain the link, title, and description fields that describe your news stories or articles that you want the world to know about. This is what every RSS reader will be looking for when it reads your document. An item is a story or headline (it can be anything you want really) that contains a Title and link to the story and a description of the story itself.

>>> More XML Articles          >>> More By Jacques Noah

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Google Docs and Xpath Data Functions
- Flex Array Collection Sort and Filtering
- The Flex Tree Control
- Flex List Controls
- Working with Flex and Datagrids
- How to Set Up Podcasting and Vodcasting
- Creating an RSS Reader Application
- Building an RSS File
- An Introduction to XUL Part 6
- An Introduction to XUL Part 5
- An Introduction to XUL Part 4
- An Introduction to XUL Part 3
- An Introduction to XUL Part 2
- An Introduction to XUL Part 1
- XML Matters: Practical XML Data Design and M...

Developer Shed Affiliates


Dev Shed Tutorial Topics: