RSS 2.0 兼容了0.91
什么是 RSS?
-----------
对于 RSS 名称的由来,没有一个标准的认定,所以,它不是一个缩写,它只是一个名字。此说明的最后一个版本可能会说它是一个缩写,希望他不会影响太多的应用软件。
RSS 是 XML 的一种。所有的 RSS 文件必须遵守 W3C 委员会发布的 XML 1.0 规范。
一个 RSS 文档是以 <rss> 元素作为最顶层,以及一个被称作 version 的托管属性,它说明了该 RSS 文件所适用的规格版本。
<rss> 元素的下属是一个单一的 <channel> 元素,包含了频道及其内容的信息。
<channel>子元素要素
---------------------
下面是<channel>元素的要素。
<title> -- channel 名。通过它人们知道如何查阅你的服务。如果你拥有一个同你的 RSS 文件相同信息的 HTML 网站,你的 channel 标题应该同你的网站标题相同。最大长度为 100 个字符。
<link> -- 指向<title>中同名的网站的 URL。最大长度为 500 个字符。
<description> -- 一个描述你的 channel 的短语,你的 channel 的状态情况。最大长度为 500 个字符。
<language> -- 提示你的 channel 使用的语言。这允许将所有使用意大利语言站点集合起来,例如,对于一个单一页面。该元素的允许值类表位于:http: //backend.userland.com/stories/storyReader$16
<image> -- 一个包含若干个子元素的 XML 元素,具体可以查看这里(*)。
<channel> 的可选子元素
----------------------
<copyright> -- channel 内容的版权信息。最长 100。
<managingEditor> -- channel 管理编辑的 email 地址,用来进行编辑内容查询的联系人。最长 100。RSS 元素建议 email 地址格式为: bull@mancuso.com (Bull Mancuso)。
<webMaster> -- channel 网管的 email 地址,技术问题咨询人员联系方式。最长 100。
<rating> -- channel 的 PICS 率。最长 500。
<pubDate> -- channel 内容的发布日期。例如,the New York Times publishes on a daily basis, the publication date flips once every 24 hours.它记录了 channel pubDate 的改变时间。所有 RSS 使用的日期和时间格式规格请参看 RFC822.
<lastBuildDate> -- channel 最后改变的日期时间。
<docs> -- 一个指向 RSS 文件中格式文档的 URL 连接。它也可能指向当前页。当一个人无意间在网站服务器上发现一个 RSS 文件,并且想知道 25 年前它是什么的时候。最长 500。
<textInput> -- 一个包含若干个子元素的 XML 元素,具体情况请见后面的说明。
<skipDays> -- 一个最多可能包含了七个<day>子元素,分别是 Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday。聚集者可能在这几天不阅读该 channel。(大多数聚集者忽略这个元素)
<skipHours> -- 一个最多包含 24 <hour> 子元素,其值分别为: 1-24,代表 GMT 时间,如果聚集者支持该属性,那么它不会在每天的所列时间读取 channel。(大多数聚集者忽略该元素)
什么是 <image>
--------------
<image> 是 <channel> 的子元素,它包含三个必要的和三个可选的子元素。
<url> 是一个描绘 channel 的 gif, jpeg 或者 png 的 URL。最长 500。
<title> 描述一个 image,当 html 中提交 channel 时,它使用 HTML <img> tag 的 ALT 属性。最长 100。
<link> 是一个网站的 url,当 channel 被提交,image 是到站点的一个连接。(注意,image 的 <title> 和 <link> 实际上应该同 channel 的 <title> 和 <link> 的值相同) 最长500。
可选元素包括 <width> 和 <height>,numbers,表明 image 的宽和高的像素。<description> 包含了被包含在 image 周围环绕的 TITLE 属性属性。
最大宽度为 144,缺省为 88.
最大高度为 400,缺省为 31.
什么是 <item>
-------------
一个 channel 可以包括任何数量的 <item>,每个连接都指向一个包含可选的描述项的内容。
<title> 为内容的标题。最长 100。
<link> 为内容的 URL。最长 500。
<description> 为内容的大纲。最长 500。
什么是 <textInput>
------------------
一个 channel 能够可选包含一个 <textInput> 子元素,它包含四个必要子元素。
<title> -- 文本输入域的提交按钮标签。最长 100。
<description> -- 文本输入域的描述。最长 500。
<name> -- 文本输入域中文本对象的名称。最长 20。
<link> -- 文本输入请求过程的 cgi 脚本 url。最大 500。
注释
====
RSS 0.91 在 <link> 和 <url> 元素数据的第一个非空白字符设置了限制。这些数据元素必须以 http:// 或者 ftp:// 开头。而其他的, https:, file:, mailto:, news:, 以及 javascript: 等等都是不允许的。
译文地址:http://www.donews.net/codez/archive/2004/08/01/rss_0_91_spec.aspx
RSS 0.91 文档:
<?xml version="1.0"?><rss version="0.91">
<channel>
<!--Required Elements Of <channel> Begin-->
<title>
<!--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.-->
<!--Maximum length is 100 characters.-->
</title>
<link>
<!--A URL pointing to the website named in the <title>.-->
<!--Maximum length is 500 characters.-->
</link>
<description>
<!--A phrase that describes your channel, your channel's positioning statement.-->
<!--Maximum length is 500 characters.-->
</description>
<language>
<!--Indicates the language your channel is written in.-->
<!--This allows aggregators to group all Italian language sites, for example, on a single page.-->
</language>
<image>
<!--Required Elements Of <image> Begin-->
<url>
<!--is the URL of a GIF, JPEG or PNG image that represents the channel.-->
<!--Maximum length is 500.-->
</url>
<title>
<!--describes the image, it's used in the ALT attribute of the HTML <img> tag when the channel is rendered in HTML.-->
<!--Maximum length is 100.-->
</title>
<link>
<!--is the URL of the site, when the channel is rendered, the image is a link to the site.-->
<!--(Note, in practice the image <title> and <link> should have the same value as the channel's <title> and <link>.-->
<!--Maximum length is 500.-->
</link>
<!--Required Elements Of <image> End-->
<!--Optional Elements Of <image> Begin-->
<width>
<!--Maximum value for width is 144, default value is 88.-->
</width>
<height>
<!--Maximum value for height is 400, default value is 31.-->
</height>
<!--Optional Elements Of <image> End-->
</image>
<!--Required Elements Of <channel> End-->
<!--Optional Elements Of <channel> Begin-->
<copyright>
<!--Copyright notice for content in the channel.-->
<!--Maximum length is 100.-->
</copyright>
<managingEditor>
<!--The email address of the managing editor of the channel, the person to contact for editorial inquiries.-->
<!--Maximum length is 100.-->
<!--The suggested format for email addresses in RSS elements is bull@mancuso.com (Bull Mancuso).-->
</managingEditor>
<webMaster>
<!--The email address of the webmaster for the channel, the person to contact if there are technical problems.-->
<!--Maximum length is 100.-->
</webMaster>
<rating>
<!--The PICS rating for the channel.-->
<!--Maximum length is 500.-->
</rating>
<pubDate>
<!--The publication date for the content in the channel.-->
<!--For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours.-->
<!--That's when the pubDate of the channel changes.-->
<!--All date-times in RSS conform to the Date and Time Specification of RFC 822.-->
</pubDate>
<lastBuildDate>
<!--The date-time the last time the content of the channel changed.-->
</lastBuildDate>
<docs>
<!--A URL, points to the documentation for the format used in the RSS file.-->
<!--It's probably a pointer to this page.-->
<!--It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is.-->
<!--Maximum length is 500.-->
</docs>
<textInput>
<title>
<!--The label of the Submit button in the text input area.-->
<!--Maximum length is 100.-->
</title>
<description>
<!--Explains the text input area.-->
<!--Maximum length is 500.-->
</description>
<name>
<!--The name of the text object in the text input area.-->
<!--Maximum length is 20.-->
</name>
<link>
<!--The URL of the CGI script that processes text input requests.-->
<!--Maximum length is 500.-->
</link>
</textInput>
<skipDays>
<!--An XML element that contains up to seven <day> sub-elements whose value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday.-->
<!--Aggregators may not read the channel during hours listed in the skipDays element.-->
<!--(Most aggregators seem to ignore this element.)-->
</skipDays>
<skipHours>
<!--An XML element that contains up to 24 <hour> sub-elements whose value is a number between 1 and 24, representing a time in GMT, when aggregators, if they support the feature, may not read the channel on days listed in the skipHours element.-->
<!--(Most aggregators seem to ignore this element.)-->
</skipHours>
<!--Optional Elements Of <channel> End-->
<item>
<!--A channel may contain any number of <item>s, each of which links to a story, with an optional description.-->
<!--Required Elements Of <item> Begin-->
<title>
<!--is the title of the story.-->
<!--Maximum length is 100.-->
</title>
<link>
<!--is the URL of the story.-->
<!--Maximum length is 500.-->
</link>
<!--Required Elements Of <item> End-->
<!--Optional Elements Of <item> Begin-->
<description>
<!--is the story synopsis.-->
<!--Maximum length is 500.-->
</description>
<!--Optional Elements Of <item> End-->
</item>
</channel>
</rss>