RSS Syntax
- Previous Page RSS History
- Next Page RSS <channel>
RSS 2.0 的语法很简单,也很严格。这些规则很容易学习,也很容易使用。
RSS 如何工作
RSS 用于在网站间分享信息。
使用 RSS,您在名为聚合器的公司注册您的内容。
步骤之一是,创建一个 RSS 文档,然后使用 .xml 后缀来保存它。然后把此文件上传到您的网站。接下来,通过一个 RSS 聚合器来注册。每天,聚合器都会到被注册的网站搜索 RSS 文档,校验其链接,并显示有关 feed 的信息,这样客户就能够链接到使他们产生兴趣的文档。
Nassosi:Tafirin: RSS birane Yan daki na yau yana nazarin kuma yana samun free RSS agwai ce kuma yana nazarin
An example RSS document
Dake RSS aiki ne kuma yana bayanin da yake bayanin
Dakarun kanannan RSS dake:
<?xml version="1.0" encoding="ISO-8859-1" ?> <rss version="2.0"> <channel> <title>CodeW3C.com Home Page</title> <link>http://www.codew3c.com</link> <description>Free web building tutorials</description> <item> <title>RSS Tutorial</title> <link>http://www.codew3c.com/rss</link> <description>New RSS tutorial on CodeW3C.com</description> </item> <item> <title>XML Tutorial</title> <link>http://www.codew3c.com/xml</link> <description>New XML tutorial on CodeW3C.com</description> </item> </channel> </rss>
Yan daki yana farko: bayanin XML - yana bayanin XML version da character encoding da aiki. Tasi ce 1.0规范, kuma yana amfani da character set ISO-8859-1 (Latin-1/West European).
Yin daki yana ce bayanin tashin da nufin daki RSS dake (tasi ce RSS version 2.0).
The next line contains the <channel> element. This element is used to describe the RSS feed.
The <channel> element has three required child elements:
- <title> - Define the title of the channel. (such as CodeW3C Home Page)
- <link> - Define the hyperlink to the channel. (such as www.codew3c.com)
- <description> - Describe this channel (such as free website building tutorials)
Each <channel> element can have one or more <item> elements.
Each <item> element can define an article or "story" in an RSS feed.
The <item> element has three required child elements:
- <title> - Define the title of the project. (such as RSS Tutorial)
- <link> - Define the hyperlink to the project. (such as http://www.codew3c.com/rss)
- <description> - Describe this project (such as CodeW3C's RSS tutorial)
Finally, the two lines at the end close the <channel> and <rss> elements.
RSS Comments
The syntax for writing comments in RSS is similar to HTML syntax:
<!-- This is an RSS comment -->
RSS uses XML to write
Because RSS is also XML, remember:
- All elements must have a closing tag
- Elements are case-sensitive
- Elements must be correctly nested
- Attribute values must be quoted
- Previous Page RSS History
- Next Page RSS <channel>