Contents
What is RSS?
RSS is a Web content syndication format.
Its name is an acronym for
Really Simple Syndication.RSS is dialect of XML. All RSS files must conform to the XML 1.0
specification, as published on the World Wide Web Consortium (W3C) website.
At the top level, a RSS document is a <rss> element, with a mandatory attribute called version, that specifies the version of RSS that the document conforms to. If it conforms to this specification, the version attribute must be 2.0.
Subordinate to the <rss> element is a single <channel> element, which contains information about the channel (metadata) and its contents.
Sample files
Here are sample files for: RSS
0.91,
0.92 and
2.0.
Note that the sample files may point to documents and services that no longer exist. The 0.91 sample was created when the 0.91 docs were written. Maintaining a trail of samples seems like a good idea.
About this document
This document represents the status of RSS as of the Fall of 2002, version 2.0.1.
It incorporates all changes and additions, starting with the basic spec for
RSS 0.91 (June 2000) and includes new features introduced in
RSS 0.92 (December 2000) and RSS 0.94 (August 2002).
Change notes are
here.
First we document the required and optional sub-elements of <channel>; and then document the sub-elements of <item>. The final sections answer frequently asked questions, and provide a roadmap for future evolution, and guidelines for extending RSS.
Required channel elements
Here's a list of the required channel elements, each with a brief description, an example, and where available, a pointer to a more complete description.
Element | Description | Example |
---|
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. | GoUpstate.com News Headlines |
link | The URL to the HTML website corresponding to the channel. | http://www.goupstate.com/ |
description | Phrase or sentence describing the channel. | The latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site. |
Optional channel elements
Here's a list of optional channel elements.
Element | Description | Example |
---|
language | The language the channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element, as provided by Netscape, is here. You may also use values defined by the W3C. | en-us |
copyright | Copyright notice for content in the channel. | Copyright 2002, Spartanburg Herald-Journal |
managingEditor | Email address for person responsible for editorial content. | geo@herald.com (George Matesky) |
webMaster | Email address for person responsible for technical issues relating to channel. | betty@herald.com (Betty Guernsey) |
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, with the exception that the year may be expressed with two characters or four characters (four preferred). | Sat, 07 Sep 2002 0:00:01 GMT |
lastBuildDate | The last time the content of the channel changed. | Sat, 07 Sep 2002 9:42:31 GMT |
category | Specify one or more categories that the channel belongs to. Follows the same rules as the <item>-level category element. More info. | <category>Newspapers</category> |
generator | A string indicating the program used to generate the channel. | MightyInHouse Content System v2.3 |
docs | A URL that 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. | http://backend.userland.com/rss |
cloud | Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds. More info here. | <cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/> |
ttl | ttl stands for time to live. It's a number of minutes that indicates how long a channel can be cached before refreshing from the source. More info here. | <ttl>60</ttl> |
image | Specifies a GIF, JPEG or PNG image that can be displayed with the channel. More info here. | |
textInput | Specifies a text input box that can be displayed with the channel. More info here. | |
skipHours | A hint for aggregators telling them which hours they can skip. More info here. | |
skipDays | A hint for aggregators telling them which days they can skip. More info here. | |
<image> sub-element of <channel>
<image> is an optional sub-element of <channel>, which contains three required and three optional sub-elements.
<url> is the URL of a GIF, JPEG or PNG image that represents the channel.
<title> describes the image, it's used in the ALT attribute of the HTML <img> tag when the channel is rendered in HTML.
<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>.
Optional elements include <width> and <height>, numbers, indicating the width and height of the image in pixels. <description> contains text that is included in the TITLE attribute of the link formed around the image in the HTML rendering.
Maximum value for width is 144, default value is 88.
Maximum value for height is 400, default value is 31.
<cloud> sub-element of <channel>
<cloud> is an optional sub-element of <channel>.
It specifies a web service that supports the rssCloud interface which can be implemented in HTTP-POST, XML-RPC or SOAP 1.1.
Its purpose is to allow processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds.
<cloud domain="radio.xmlstoragesystem.com" port="80" path="/RPC2" registerProcedure="xmlStorageSystem.rssPleaseNotify" protocol="xml-rpc" />
In this example, to request notification on the channel it appears in, you would send an XML-RPC message to radio.xmlstoragesystem.com on port 80, with a path of /RPC2. The procedure to call is xmlStorageSystem.rssPleaseNotify.
A full explanation of this element and the rssCloud interface is
here.
<ttl> sub-element of <channel>
<ttl> is an optional sub-element of <channel>.
ttl stands for time to live. It's a number of minutes that indicates how long a channel can be cached before refreshing from the source. This makes it possible for RSS sources to be managed by a file-sharing network such as
Gnutella.
Example: <ttl>60</ttl>
<textInput> sub-element of <channel>
A channel may optionally contain a <textInput> sub-element, which contains four required sub-elements.
<title> -- The label of the Submit button in the text input area.
<description> -- Explains the text input area.
<name> -- The name of the text object in the text input area.
<link> -- The URL of the CGI script that processes text input requests.
The purpose of the <textInput> element is something of a mystery. You can use it to specify a search engine box. Or to allow a reader to provide feedback. Most aggregators ignore it.
Elements of <item>
A channel may contain any number of <item>s. An item may represent a "story" -- much like a story in a newspaper or magazine; if so its description is a synopsis of the story, and the link points to the full story. An item may also be complete in itself, if so, the description contains the text (entity-encoded HTML is allowed), and the link and title may be omitted. All elements of an item are optional, however at least one of title or description must be present.
Element | Description | Example |
---|
title | The title of the item. | Venice Film Festival Tries to Quit Sinking |
link | The URL of the item. | http://www.nytimes.com/2002/09/07/movies/07FEST.html |
description | The item synopsis. | Some of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged. |
author | Email address of the author of the item. More. | oprah@oxygen.net |
category | Includes the item in one or more categories. More. | Simpsons Characters |
comments | URL of a page for comments relating to the item. More. | http://www.myblog.org/cgi-local/mt/mt-comments.cgi?entry_id=290 |
enclosure | Describes a media object that is attached to the item. More. | <enclosure url="http://live.curry.com/mp3/celebritySCms.mp3" length="1069871" type="audio/mpeg"/> |
guid | A string that uniquely identifies the item. More. | <guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid> |
pubDate | Indicates when the item was published. More. | Sun, 19 May 2002 15:21:36 GMT |
source | The RSS channel that the item came from. More. | <source url="http://www.quotationspage.com/data/qotd.rss">Quotes of the Day</source> |
<source> sub-element of <item>
<source> is an optional sub-element of <item>.
Its value is the name of the RSS channel that the item came from, derived from its <title>. It has one required attribute, url, which links to the XMLization of the source.
<source url="http://static.userland.com/tomalak/links2.xml">Tomalak's Realm</source>
The purpose of this element is to propogate credit for links, to publicize the sources of news items. It's used in the post command in the Radio UserLand aggregator. It should be generated automatically when forwarding an item from an aggregator to a weblog authoring tool.
<enclosure> sub-element of <item>
<enclosure> is an optional sub-element of <item>.
It has three required attributes. url says where the enclosure is located, length says how big it is in bytes, and type says what its type is, a standard MIME type.
The url must be an http url.
<enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" />
A use-case narrative for this element is
here<category> sub-element of <item>
<category> is an optional sub-element of <item>.
It has one optional attribute, domain, a string that identifies a categorization taxonomy.
The value of the element is a forward-slash-separated string that identifies a hierarchic location in the indicated taxonomy. Processors may establish conventions for the interpretation of categories. Two examples are provided below:
<category>Grateful Dead</category>
<category domain="http://www.fool.com/cusips">MSFT</category>
You may include as many category elements as you need to, for different domains, and to have an item cross-referenced in different parts of the same domain.
<pubDate> sub-element of <item>
<pubDate> is an optional sub-element of <item>.
Its value is a
date, indicating when the item was published. If it's a date in the future, aggregators may choose to not display the item until that date.
<pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate>
<guid> sub-element of <item>
<guid> is an optional sub-element of <item>.
guid stands for globally unique identifier. It's a string that uniquely identifies the item. When present, an aggregator may choose to use this string to determine if an item is new.
<guid>http://some.server.com/weblogItem3207</guid>
There are no rules for the syntax of a guid. Aggregators must view them as a string. It's up to the source of the feed to establish the uniqueness of the string.
If the guid element has an attribute named "isPermaLink" with a value of true, the reader may assume that it is a
permalink to the item, that is, a url that can be opened in a Web browser, that points to the full item described by the <item> element. An example:
<guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid>
isPermaLink is optional, its default value is true. If its value is false, the guid may not be assumed to be a url, or a url to anything in particular.
<comments> sub-element of <item>
<comments> is an optional sub-element of <item>.
If present, it is the url of the comments page for the item.
<comments>http://rateyourmusic.com/yaccs/commentsn/blogId=705245&itemId=271</comments>
<author> sub-element of <item>
<author> is an optional sub-element of <item>.
It's the email address of the author of the item. For newspapers and magazines syndicating via RSS, the author is the person who wrote the article that the <item> describes. For collaborative weblogs, the author of the item might be different from the managing editor or webmaster. For a weblog authored by a single individual it would make sense to omit the <author> element.
<author>lawyer@boyer.net (Lawyer Boyer)</author>
Comments
RSS places restrictions on the first non-whitespace characters of the data in <link> and <url> elements. The data in these elements must begin with an
IANA-registered URI scheme, such as http://, https://, news://, mailto: and ftp://. Prior to RSS 2.0, the specification only allowed http:// and ftp://, however, in practice other URI schemes were in use by content developers and supported by aggregators. Aggregators may have limits on the URI schemes they support. Content developers should not assume that all aggregators support all schemes.
In RSS 0.91, various elements are restricted to 500 or 100 characters. There can be no more than 15 <items> in a 0.91 <channel>. There are no string-length or XML-level limits in RSS 0.92 and greater. Processors may impose their own limits, and generators may have preferences that say no more than a certain number of <item>s can appear in a channel, or that strings are limited in length.
In RSS 2.0,
a provision is made for linking a channel to its identifier in a cataloging system, using the channel-level category feature, described above. For example, to link a channel to its Syndic8 identifier, include a category element as a sub-element of <channel>, with domain "Syndic8", and value the identifier for your channel in the Syndic8 database. The appropriate category element for Scripting News would be <category domain="Syndic8">1765</category>.
A frequently asked question about <guid>s is how do they compare to <link>s. Aren't they the same thing? Yes, in some content systems, and no in others. In some systems, <link> is a permalink to a weblog item. However, in other systems, each <item> is a synopsis of a longer article, <link> points to the article, and <guid> is the permalink to the weblog entry. In all cases, it's recommended that you provide the guid, and if possible make it a permalink. This enables aggregators to not repeat items, even if there have been editing changes.
If you have questions about the RSS 2.0 format, please post them on the
RSS2-Support mail list, hosted by Sjoerd Visscher. This is not a debating list, but serves as a support resource for users, authors and developers who are creating and using content in RSS 2.0 format.
Extending RSS
RSS originated in 1999, and has strived to be a simple, easy to understand format, with relatively modest goals. After it became a popular format, developers wanted to extend it using modules defined in namespaces, as
specified by the W3C.
RSS 2.0 adds that capability, following a simple rule. A RSS feed may contain elements not described on this page, only if those elements are defined in a namespace.
The elements defined in this document are not themselves members of a namespace, so that RSS 2.0 can remain compatible with previous versions in the following sense -- a version 0.91 or 0.92 file is also a valid 2.0 file. If the elements of RSS 2.0 were in a namespace, this constraint would break, a version 0.9x file
would not be a valid 2.0 file.
Here's an
example of a file that makes use of elements in namespaces, authored by Mark Pilgrim.
Roadmap
RSS is by no means a perfect format, but it is very popular and widely supported. Having a settled spec is something RSS has needed for a long time. The purpose of this work is to help it become a unchanging thing, to foster growth in the market that is developing around it, and to clear the path for innovation in new syndication formats. Therefore, the RSS spec is, for all practical purposes, frozen at version 2.0.1. We anticipate possible 2.0.2 or 2.0.3 versions, etc. only for the purpose of clarifying the specification, not for adding new features to the format. Subsequent work should happen in modules, using namespaces, and in completely new syndication formats, with new names.
Copyright and disclaimer
© Copyright 1997-2002 UserLand Software. All Rights Reserved.This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and these paragraphs are included on all such copies and derivative works.
This document may not be modified in any way, such as by removing the copyright notice or references to UserLand or other organizations. Further, while these copyright restrictions apply to the written RSS specification, no claim of ownership is made by UserLand to the format it describes. Any party may, for commercial or non-commercial purposes, implement this format without royalty or license fee to UserLand. The limited permissions granted herein are perpetual and will not be revoked by UserLand or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and USERLAND DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
RSS 2.0 标准
来源Q?a >http://www.cpcwedu.com/Document/WEBOfficial/095447158.htm
什么是 RSS?
RSS 是一U站点内容聚合的格式?br />
它的名字?em>Really Simple Syndication 的的写?/p>
RSS是XML的一U。所有的RSS文档都遵?XML 1.0规范, 该规范发布在W3C|站上?/p>
q里是RSS版本历史的一个概要?br />
在一个RSS文档中,最外层是一?lt;rss>元素Q这个元素必规定version属性,该属性明了本文档遵从何URSS版本规范。如果一个RSS文档以这个规范来表示Q那么它的version属性就必须?.0?/p>
<rss>元素只有一个子元素<channel>Q包含了关于q个频道(元数?和它的内容的一些信息?br />
h文g
q里有一些RSSh文gQ?RSS 0.91, 0.92 ?2.0?br />
注意q些h文g所指向的链接地址和服务器可能已经不再存在。在撰写0.91文档的时候,q个0.91的样本文件就已经创徏了。维护一个样本文件的历史也许是一个不错的L?br />
关于本文?a target="_blank">
本文档完成于2002q秋天,版本?2.0.1?br />
它包含从 RSS 0.91 规范(2000q?开始的所有的修改和添加,以及(qing)包含?a target="_blank">RSS 0.92 Q?000q?2月)(j)和RSS 0.94Q?002q?月)(j)中的新的Ҏ(gu)?br />
详细的文档历史纪录请参阅q里?br />
本文档中首先介绍必须的和可选的频道元素Q接着介绍?lt;item>的子元素。最后回{了一些经常碰到的问题Qƈ提供了未来的发展路线和RSS扩展的指导方针?/p>
必需的频道元?a target="_blank">
下面是一个必d含的频道(channel)元素的列表,每一个都有一个简单的描述、一个例子、应该出现的位置和更详细描述的链接地址?/p>
01.● title
名称Qtitle
描述Q频道的名称。它表明别h如何讉K你的服务。如果你有一个与你的RSS文g内容一致的HTML|站Q你的title元素值应该与你的|站的标题相同?
例子QGoUpstate.com 的新d字标题?
02.● link
名称Qlink
描述Q对应频道的|站的URL链接地址?
例子Qhttp://www.goupstate.com/ ?
03.● description
名称Qdescription
描述Q关于频道的描述?
例子QThe latest news from GoUpstate.com, a Spartanburg Herald-Journal Web site?/p>
可选的频道元素
下面是一个可选的频道(channel)元素的列表?
01.● language
名称Qlanguage
描述Q频道用的语言。比如,在一个网站上Q允许聚合所有的意大利语站点到相应的分组。对于这个元素,可用的|参阅 Netscape提供?a target="_blank">清单。或者可以参阅W3C定义?清单?
例子Qen-us?
02.● copyright
名称Qcopyright
描述Q频道内容的版权声明?
例子QCopyright 2002, Spartanburg Herald-Journal
03.● managingEditor
名称QmanagingEditor
描述Q频道内容责ȝ辑的?sh)子邮g地址?
例子Qgeo@herald.com (George Matesky)
04.● webMaster
名称QwebMaster
描述Q频道技术支持h员的?sh)子邮g地址?
例子Qbetty@herald.com (Betty Guernsey)
05.● pubDate
名称QpubDate
描述Q频道内容发布的日期。所有的日期和时间都必须遵@ RFC 822规范, 但年份可以用Q个或4个字母表C?首选4个字??
例子QSat, 07 Sep 2002 00:00:01 GMT
06.● lastBuildDate
名称QlastBuildDate
描述Q频道内容的最后修Ҏ(gu)间?
例子QSat, 07 Sep 2002 09:42:31 GMT
07.● category
名称Qcategory
描述Q指定频道所属的一个或多个分类。遵循与itemUcategory元素相同的规则。详?a target="_blank">q里?
例子Q?lt;category>Newspapers</category>
08.● generator
名称Qgenerator
描述Q表明生成频道的E序名称的字W串?
例子QMightyInHouse Content System v2.3
09.● docs
名称Qdocs
描述Q指向该RSS文g所用格式说明文档的URL链接地址?
例子Qhttp://blogs.law.harvard.edu/tech/rss?
10.● cloud
名称Qcloud
描述Q允?dng)R过注册一个cloud来处理获得频道的更新通知Qƈ为rssU子实现一个轻量的发布订阅协议,详见q里?
例子Q?lt;cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/>
11.● ttl
名称Qttl
描述Qttl是Time to live的羃写,表示生存旉。它表示频道从源更新之前可以~存的时间。详?q里?
例子Q?lt;ttl>60</ttl>?
12.● image
名称Qimage
描述Q指定一个可以在频道中显C的GIF、JPEG或?PNG 囑փ。详?a target="_blank">q里?
例子Q?/p>
13.● rating
名称Qrating
描述Q频道的 PICS 内容分信息?
例子Q??/p>
14.● textInput
名称QtextInput
描述Q指定一个可以在频道中显C的文本输入框。详?a target="_blank">q里?br />例子Q?
15.● skipHours
名称QskipHours
描述Q提C合器Q可以蟩q那些小时的旉Dc(din)详?a target="_blank">q里?br />例子Q?
16.● skipDays
名称QskipDays
描述Q提C合器Q可以蟩q那些天的时间段。详?a target="_blank">q里?
例子Q?
<channel>的子元素<image>
<image> ?<channel>的一个可选子元素, 它本w包含了三个必须的和三个可选的子元素?/p>
<url>是一个GIF、JPEG或PNG囑փ文g的URL链接地址Q该囑փ代表整个频道?/p>
<title>用于描述上面的图像,当频道在HTML中显C时Q用于HTML语言中的<img>的alt属性?/p>
<link>是要q接的站点的urlQ当昄频道Ӟ囑փ的连接指向该站点?在实际中Q?lt;title>?lt;link>应该与频道的<title>?lt;link>有相同的??/p>
可选的元素包括<width>?lt;height>Q它们是数字cdQ指定图像的宽度和高度,单位为像素?br /><description>是link的TITLE属性中文本Q它?yu)在调用|页时显C出来?
囑փ宽度的最大gؓ(f)144Q默认gؓ(f)88 ?/p>
囑փ高度的最大gؓ(f)400Q默认gؓ(f)31 ?br />
<channel>的子元素<cloud>
<cloud> ?<channel>的一个可选子元素?/p>
它指定一个可以支持rssCloud接口的web服务QrssCloud接口可以在HTTP-POST、XML-RPC或SOAP1.1中实现?/p>
它的目的是允?dng)R过注册一个cloud来处理获得频道的更新通知Q从而ؓ(f)RSS feeds实现一个轻量的发布订阅协?
<cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="myCloud.rssPleaseNotify" protocol="xml-rpc" />
在这个例子中Qؓ(f)了请求频道通知Q你需要发送一个XML-RPC消息到rpc.sys.com?0端口Q\径ؓ(f)/RPC2。调用的E序Zؓ(f)myCloud.rssPleaseNotify?
q个元素的详l说明和 rssCloud 接口说明请参?q里?br />
<channel>子元?lt;ttl>
<ttl><channel>的一个可选子元素?/p>
ttl是Time to live的羃写,表示生存旉。它表示频道从源重新更新之前可以~存的时间。这使得rss源可以被一个支持文件共享的|络所理Q例?a target="_blank">Gnutella?br />
例子: <ttl>60</ttl>
<channel>的子元素<textInput>
频道可以选择包含一?lt;textInput>子元素,它本w包含了四个必须的子元素?/p>
<title>--文本输入区域提交按钮的标{?/p>
<description>--文本输入区域的描q?/p>
<name>--文本输入区域中文本对象的名称?/p>
<link>--处理文本输入h的CGI脚本的URL链接地址?/p>
使用<textInput>元素的目的看h有些秘。你可以用它提供一个搜索引擎输入框Q或让读者提供反馈信息。许多聚合器忽略该元素?
<item>的元?a target="_blank">
一个频道可以包含许?lt;item>元素。一个项目可以代表一?故事" ——比如说一份报U或杂志上的故事Q如果是q样的话Q那么项目的描述则是故事的摘要,目的链接则指向整个故事的链接位|。一个项目也可以本n是完整的Q如果是q样的话Q项目的描述包含了文本(整体以HTML格式~码是可以的Q参?例子)Q而链接和标题可以省略。项目的所有元素都是可选的Q但是至要包含一个标?title)或描q?description)?
01.● title
名称Qtitle
描述Qitem的标题?
例子QVenice Film Festival Tries to Quit Sinking
02.● link
名称Qlink
描述Qitem的URL链接地址?
例子Q?a target="_blank">http://nytimes.com/2004/12/07FEST.html
03.● description
名称Qdescription
描述Qitem的摘要?
例子QSome of the most heated chatter at the Venice Film Festival this week was about the way that the arrival of the stars at the Palazzo del Cinema was being staged.
04.● author
名称Qauthor
描述Qitem作者的?sh)子邮g地址。详?a target="_blank">q里?br />例子Q?
05.● category
名称Qcategory
描述Q包含item在一个或多个分类中。详?a target="_blank">q里?
例子Q?
06.● comments
名称Qcomments
描述Q与item相关的评论的URL链接地址。详?q里?
例子Q?
07.● enclosure
名称Qenclosure
描述Qitem附加的媒体对象。详?a target="_blank">q里?br />例子Q?
08.● guid
名称Qguid
描述Q可以唯一定itemw䆾的字W串。详?q里?br />例子Q?
09.● pubDate
名称QpubDate
描述Qitem发布的时间。详?q里?br />例子Q?
10.● source
名称Qsource
描述Qrss频道来源。详?q里?br />例子Q?
<item>的子元素<source>
<source>?lt;item>的一个可选子元素?br />
它的值是item所属rss频道的名Uͼ从title衍生而来。它有一个必d含的属性url, 该属性链接到XML序列化源?/p>
<source url="http://www.tomalak.org/links2.xml">Tomalak's Realm</source>
该元素的作用是提高链接的声望Q从而进一步推q新闻项目的源头。它可以用在聚合器的Post命o(h)中。当从聚合器中通过一个webblog~辑工具提交一个itemӞ<source>应该能够被自动生成?br />
<item>的子元素<enclosure>
<enclosure>?lt;item>的一个可选子元素?/p>
它有三个必须的属性。url属性表明enclosure的位|,length属性表明它的字节大,而type属性则指出它的标准MIMEcd?/p>
q里的url必须Z个http url?
<enclosure url="http://www.scripting.com/mp3s/weatherReportSuite.mp3" length="12216320" type="audio/mpeg" />
它的 use-case 说明请参?a target="_blank">q里?br />
<item>的子元素<category>
<category>?lt;item>的一个可选子元素?/p>
它有一个可选属性domainQ该属性是一个用来定义分cL的字W串?
该节点的值是一个斜杠分割的字符Ԍ它用来表明在指定的分cL中的层次位置。处理器可以为分cȝ识别建立协定。以下是两个例子Q?
<category>Grateful Dead</category>
<category domain="http://www.fool.com/cusips">MSFT</category>
你可以根据需要ؓ(f)不同的域包含很多<category>元素Qƈ且可以在相同域的不同部分拥有一个交叉引用的item?
<item>的子元素<pubDate>
<pubDate> ?lt;item>的一个可选子元素?/p>
它的值是一?日期, 表明目发布的时间。如果它是一个将来的日期Q则聚合器在日期到达之前可以选择不显C目。?br />
<pubDate>Sun, 19 May 2002 15:21:36 GMT</pubDate>
<item>的子元素<guid>
<guid>?lt;item>的一个可选子元素?/p>
guid ?globally unique identifier的羃写。它是一个可以唯一识别q个<item>的字W串。在发布之后Q聚合器可以选择使用该字W串判断q个<item>是否是新的。?/p>
<guid>http://some.server.com/weblogItem3207</guid>
guid没有特定的语法规则。聚合器必须它们当作一个字W串来处理。生成具有唯一性的字符串guid取决于种子的源头?
如果guid元素有isPermaLink属性,q且gؓ(f)真,解释器就?x)认为它是item的permalink。permalink是一个可在web览器中打开的url链接Q它指向<item>节点所描述的完整item?例如Q?/p>
<guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid>
isPermaLink是可选属性,默认gؓ(f)真。如果gؓ(f)假,guid不?x)被认?f)是一个url或指向Q何对象的url?
<item>的子元素<comments>
<comments>?lt;item>的一个可选子元素?/p>
如果出现Q它指向与item相关的评论的url?br />
<comments>http://ekzemplo.com/entry/4403/comments</comments>
更多信息Q请参阅 q里?br />
<item>的子元素<author>
<author>?lt;item>的一个可选子元素?/p>
它是item作者的?sh)子邮g地址l。对于通过rss传播的报U和杂志Q作者可能是写该item所描述的文章的人。对于聚集型webblogsQ作者可能不是责ȝ辑或站长。对于个人维护的webblogQ忽?lt;author>节点是有意义的?/p>
<author>lawyer@boyer.net (Lawyer Boyer)</author>
注释
RSS限制<link> ?<url>元素的数据首字母为非I格字符。这些元素的数据必须?a target="_blank">IANA-registered URIҎ(gu)规定的格式开始,如http://, https://, news://, mailto:?ftp://{。在RSS2.0规范之前QRSS规范只允许http:// ?ftp://Q然而在实践中,其他的URIҎ(gu)被内容开发者广泛用,q被聚合器所支持。聚合器也许对它们支持的URIҎ(gu)有一些限Ӟ而内容开发者不应该假定所有的聚合器都支持所有的URIҎ(gu)?/p>
?RSS 0.91规范中,各种元素都被限制?00?00个字W。在一个符?.91规范的频道中Q不能超q?5?<item> 元素。在RSS 0.92和以后的规范中,不再有这些字W长度或者XMLU别的限制。处理器也许强加一些它们自q限制Q生者也许有自己的一些参数选择Q它们可以规定在一个频道中Q不过一定数目的<item>元素Q或者字W串都限制在一定的长度。?/p>
如上所qͼ在 RSS 2.0规范中,对于一个目录系l,当链接一个频道到它的标识中时Q用基于频道别的分类特征?例如Q如果链接一个频道到它的Syndic8 标识Q则包括一个分cd素作为频道的子元素,它有域“Syndic8”属性,同时在Syndic8 数据库中Z的频道确定这个标识。正的分类元素脚本应该?<category domain="Syndic8">1765</category>?br />
一个经常被问到的问题是关于<guid> 如何?<link>q行区别。它们指的是相同的事情吗Q在一些内容系l中是,但在别的内容pȝ中可能不是。在一些系l中Q?lt;link>是一个网l日志项的永久链接。然后在别的pȝ中,每一?lt;item>都是一个较长文章的摘要Q?lt;link>指向q篇文章Q?lt;guid>则是q个|络日志入口的永久链接。在所有的情况下,提供<guid>,如果可能的话Qƈ使它成ؓ(f)一个永久链接。这使聚合着在内容发生变化时Q也不会(x)出现重复目成ؓ(f)可能?/p>
如果你对RSS 2.0规范的格式有M问题Q请向由Sjoerd Visscherl护的电(sh)子邮件列?a target="_blank">RSS2-Support发送邮件。这个邮件列表不是一个技术辩论的列表Q而是一个针对作者和开发h员在创徏和用RSS 2.0格式的内Ҏ(gu)提供技术支持的列表?/p>
RSS的扩?a target="_blank">
RSSh?999q_(d)目标是成Z个简单、易于理解的数据格式。在它逐渐成ؓ(f)一U流行格式之后,开发者想在一个名字空间中使用模块对它q行扩展Q正像W3C定义的那栗?
RSS遵@单的规则Q增加了它的能力。一个RSS feed 可以包含不是在本中描述的内容,而只是在一个名字空间中定义的那些元素?br />
本文档中定义的元素不是一个名字空间本省的元素Q因此, RSS2.0从某U意义上来讲Q和原来的版本是兼容的,即一?0.91 或?0.92 版本的文件也是一个有效的 2.0 版本文g。如果RSS2.0的元素是在一个名字空间中Q那么这U约束将被打_(d)?一?.9x 版本的文件不可能是一个有效的2.0 版本的文件?br />
发展方向
RSS决不是一个完的格式Q但是它现在已经非常行Qƈ得到q泛的支持。要成ؓ(f)一个固定的规范QRSS需要很长的一D|间。这工作的目的是帮助RSS成ؓ(f)一个固定的事情Q同时促q和培育围绕它进行的开发的市场的增长,qؓ(f)新的聚合格式铺^道\。因此,Z实用的目的,RSS规范?yu)被ȝ?.0.2版本。我们可以预期的可能?.0.2 或?2.0.3{版本,都只是出于澄清规范的目的Q而不是在格式上增加新的特征。后l的工作应该集中在模块化、名字空间的使用和在完全新的聚合格式中用新的名字{方面?/p>
许可协议和作?a target="_blank">
RSS 2.0 是在遵@i the Attribution/Share Alike Creative Commons 许可协议 的基上由 the Berkman Center for Internet & Society at Harvard Law School 提供。本文档的作者是 Dave WinerQUserLand software的创始hQ也?Berkman Center 的员工?br />