RSS 元素

The RSS <channel> element describes the RSS feed.
RSS <channel>元素是描述RSS 输入端(feed)的。


The RSS <channel> Element
RSS <channel>元素

Look at the following RSS document:
让我们先来看一下RSS文件:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<rss version="2.0">
<channel>
<title>W3Schools Home Page</title>
<link>http://www.w3schools.com</link>
<description>Free web building tutorials</description>

<item>
<title>RSS Tutorial</title>
<link>http://www.w3schools.com/rss</link>
<description>New RSS tutorial on W3Schools</description>

</item>
</channel>
</rss>

As mentioned before, the <channel> element describes the RSS feed, and has three required child elements:
如以前提及的一样,<channel>元素形容的是RSS 输入端(feed)及其3个必须子元素:

  • <title> - Defines the title of the channel (e.g. W3Schools Home Page)
    <title>定义了channel的标题 (比如:W3School主页)
  • <link> - Defines the hyperlink to the channel (e.g. http://www.w3pop.com)
    <link> - 定义了到channel的超链接(比如:http://www.w3pop.com)
  • <description> - Describes the channel (e.g. Free web building tutorials)
    <description>定义了channel(如:Free web building 教程)

The <channel> element usually contains one ore more <item> elements. Each <item> element defines an article or "story" in the RSS feed.
<channel>元素经常包含一个或多个<item>元素。每个<item>元素定义了一个条款或RSS输入端(feed)中的"story"。

Furthermore, there are several optional child elements of <channel>. We will explain the most important ones below.
此外,还有一些任意参数<channel>子元素。接下来,我们将说明一些比较重要的元素。


The <category> Element
<category>元素

The <category> child element is used to specify a category for your feed.
<category>子元素的作用:详细说明输入端(feed)类别.

The <category> element makes it possible for RSS aggregators to group sites based on category.
通过<category>元素,可以使RSS aggregators对基于同一类别(category)的内容集合起来。

The category for the RSS document above could be:
对于上述的RSS文件,其category应该是:

<category>Web development</category>


The <copyright> Element
<copyright>元素

The <copyright> child element notifies about copyrighted material.
<copyright>子元素是用来描述版权材料的。

The copyright for the RSS document above could be:
对于上面的RSS文件,版权(copyright)应该是:

<copyright>2006 Refsnes Data as. All rights reserved.</copyright>


The <image> Element
<image>元素

The <image> child element allows an image to be displayed when aggregators present a feed.
<image>子元素允许在aggregators 显示一个输入口(feed)的时候显示图像。

The <image> element has three required child elements:
<image>元素有3个必须子元素:

  • <url> - Defines the URL to the image
    <url>定义了图像的URI
  • <title> - Defines the text to display if the image could not be shown
    <title>定义了当图像无法显示时显示文本
  • <link> - Defines the hyperlink to the website that offers the channel
    <link>定义了提供channel的站点超链接

The image for the RSS document above could be:
对于RSS文件,图形应该是:

<image>
<url>http://www.w3schools.com/images/logo.gif</url>
<title>W3Schools.com</title>

<link>http://www.w3schools.com</link>
</image>


The <language> Element
<language>元素

The <language> child element is used to specify the language used to write your document.
<language>子元素的作用:详细说明用于编写文件的语言。

The <language> element makes it possible for RSS aggregators to group sites based on language.
<language>元素使RSS aggregators能够群组基于某一种语言(labguage)的站点

The language for the RSS document above could be:
上述RSS文件的语言应该是:

<language>us-en</language>


RSS <channel> Reference
RSS <channel> 参数

Element
元素
Description
描述
<category>Optional. Defines one or more categories for the feed
任意参数。为输入端(feed)定义一个或多个类(categories)
<cloud>Optional. Register processes to be notified immediately of updates of the feed
任意参数。提示注册者进行输入端(feed)的升级
<copyright>Optional. Notifies about copyrighted material
任意参数。用于写明版权材料
<description>Required. Describes the channel
任意参数,形容channel
<docs>Optional. Specifies an URL to the documentation of the format used in the feed
任意参数。指明了用于输入端(feed)格式的文件的URI
<generator>Optional. Specifies the program used to generate the feed
任意参数。指明了用于产生feed的程序
<image>Optional. Allows an image to be displayed when aggregators present a feed
任意参数。当aggregators 产生一个输入端(feed)时,允许显示图像
<language>Optional. Specifies the language the feed is written in
任意参数。详细说明了编写输入端(feed)的语言
<lastBuildDate>Optional. Defines the last-modified date of the content of the feed
任意参数。定义了输入端(feed)内容的最后更新日期
<link>Required. Defines the hyperlink to the channel
必要参数。定义了到channel的超链接
<managingEditor>Optional. Defines the e-mail address to the editor of the content of the feed
任意参数。定义了输入端(feed)内容编辑者的电子邮件地址
<pubDate>Optional. Defines the last publication date for the content of the feed
任意参数。定义了输入端(feed)内容的最新出版日期
<rating>Optional. The PICS rating of the feed
任意参数。指明输入端(feed)的PICS等级
<skipDays>Optional. Specifies the days where aggregators should skip updating the feed
任意参数。指定aggregators跳过输入端(feed)更新的具体天数(day)。
<skipHours>Optional. Specifies the hours where aggregators should skip updating the feed
任意参数。指定aggregators跳过更新输入端(feed)的小时(hour)
<textInput>Optional. Specifies a text input field that should be displayed with the feed
任意参数。制定了输入端(feed)显示的文本输入栏
<title>Required. Defines the title of the channel
必要参数。定义了channel的标题(title)
<ttl>Optional. Specifies the number of minutes the feed can stay cached before refreshing it from the source
任意参数。详细说明了在资源库更新之前输入端(feed)可以隐藏的分钟数。(minute)
<webMaster>Optional. Defines the e-mail address to the webmaster of the feed
任意参数。定义了输入端(feed)网络管理员的电子邮件地址
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值