English Original:
Http://blogs.law.harvard.edu/tech/rss
The Chinese explanation on IBM:
Http://www-900.ibm.com/developerWorks/cn/xml/x-rss20/index.shtml
RSS 2.0 Overview
RSS is an XML dialect used to chain WEB content and metadata. RSS 0.91 is the most commonly used version of several available versions. A better approach to the new RSS feed is to use version 2.0, because this is the current specification and, as mentioned earlier, it is backward compatible with 0.91.
Dave Winer has written the specification of version 2.0. The modification of the specification may become difficult to use, or damage an existing application, and he deliberately avoids this situation. Winer summed up his thought: "Keep it simple." This is the value of RSS. Anyone who has a little knowledge of HTML can understand RSS. This is extremely important! ”
The specification is published under the Creative Commons license (see Resources). This means that you can reproduce and distribute the specification free of charge, carry out derivative work, and be free to work in business. An Advisory committee is responsible for updating specifications, promoting specifications and writing documentation.
RSS file Form
The RSS file consists of a <channel> element and its child elements. In addition to the channel content itself,,</channel><channel> includes elements that represent channel metadata, such as <title>, <link>, and <description>. Items are usually the main part of a channel and contain frequently changing content.
Channel
Channels typically have three elements that provide information about the channel itself:
<title>: The name of the channel or feed.
<link>: The URL of the Web site or site zone associated with the channel.
<description>: A brief description of what the channel does.
Many of the channel child elements are optional. The commonly used <image> elements contain three required child elements:
<url>: The URL that represents the GIF, JPEG, or PNG image for the channel.
<title>: Description of the image. Used as an ALT attribute for HTML <image> tags when the channel is rendered in HTML.
<link>: URL of the site. If the channel is rendered in HTML, the image is used as a link to this site.
<image> also has three optional child elements:
<width>: A number that represents the pixel width of the image, with a maximum value of 188 and a default value of 88.
<description>: Contains text that, when rendered, can be used as the title attribute of the link element that is formed around the image.
There are also many other optional channel elements that can be used. Most of them are self-evident:
<language>:en-us
<copyright>:copyright 2003, James Lewin
<managingeditor>:dan@spam_me.com (Dan DeleteKey)
<webmaster>:dan@spam_me.com (Dan DeleteKey)
<pubdate>:sat, Nov 2003 0:00:01 GMT
<lastbuilddate>:sat, Nov 2003 0:00:01 GMT
<category>:ebusiness
<generator>:your CMS 2.0
<docs>:http://blogs.law.harvard.edu/tech/rss
<CLOUD>: Allows a process to register as "cloud", notifies it when the channel is updated, and implements a lightweight publish-subscribe protocol for the RSS feed.
<ttl>: Survival time is a number that represents the number of minutes a feed is buffered before it is refreshed.
<RATING>: A PICS evaluation of the channel.
<TEXTINPUT>: Defines an input box that can be displayed with the channel.
<skiphours>: Tells the collector which hours of updates can be ignored.
<skipdays>: Tell the collector that the day's update can be ignored.
Item
Items are usually the most important part of the feed. Each item can be a record of a weblog, full document, movie review, classified ad, or any content that you want to link to the channel. Other elements in the channel may not change, but the items are often changed.
You can have any number of items. The previous specification limit is 15 items, which is still a good upper limit if you want to keep backwards compatibility.
Elements of a news item
Each item typically contains three elements:
<title>: This is the name of the item, which is converted to the title in the HTML in the standard application.
<link>: This is the URL of the item. Title usually serves as a link to the URL contained in the </link><link> element.
<description>: Usually as a summary or supplement to the URL pointed to in link.
All elements are optional, but an item contains at least one <title>, or one <description>.
There are some other optional elements of the item:
<author>: The author's e-mail address.
<CATEGORY>: Support for organized records.
<comments>: The URL of the comment page for the item.
<ENCLOSURE>: Supports media objects related to this item.
<guid>: The only permanent link that is associated with the item.
<PUBDATE>: When the item was released.
<source>: This entry is from which RSS channel, which is useful when aggregating items together.
RSS 2.0 Specification
Channel part
Title channel name must be
The URL of the link channel must be
The description of the Description channel must be
Language channel articles are available in the language of choice
Copyright Note optional
Managingeditor Manager's Email optional
Webmaster Webmaster Email Optional
pubdate Channel Release date optional (note time must be strictly compliant with RFC-822)
Lastbuilddate Channel last Modified date optional
Category Channel category optional
Generator The program name to generate the channel is optional
Docs The URL of the RSS file is optional
TTL Expiration is optional
Image channel icon Optional
Rating Channel level optional
Skiphours can be skipped hours optional
Skipdays can be skipped days optional
Item section
Title headings must be
Link This article's links must
Description described or referred to as abstracts must be
Author author's email optional
Category The classification of the article is optional
Comments the link to this article comment is optional
Enclosure the files included with this article are optional
GUID This article unique identification mark (currently no specification, generally use the article link representation) optional
pubdate Publication Time Optional
Source article origin link optional
Example:
Copy Code code as follows:
<?xml version= "1.0" encoding= "UTF-8"?>
<rss version= "2.0" >
<channel>
<TITLE>D.C life</title>
<link>http://blog.it580.com/</link>
<description>david && Cindy | | Xiami &&XlAMl.</description>
<language>zh-cn</language>
<pubdate>tue, June 2003 04:00:00 gmt</pubdate>
<lastbuilddate>tue, June 2003 09:41:01 gmt</lastbuilddate>
<generator>xiami edit</generator>
<managingeditor>editor@name.com</managingeditor>
<webmaster>webmaster@name.com</webmaster>
<item>
<title> Example File </title>
<link>
http://blog.it580.com/Sample_files.php
</link>
<description>
This is an example file
</description>
<pubdate>tue June 2003 09:39:21 gmt</pubdate>
<guid>
http://blog.it580.com/Sample_files.php
</guid>
</item>
</channel>
</rss>