RSS enclosure Element
定義和用法
<enclosure> 元素允許把媒體文件包含在項目中。
屬性
屬性 | 描述 |
---|---|
length | 必需。 定義媒體文件的長度(以字節計)。 |
type | 必需。 定義媒體文件的類型。 |
url | 必需。 定義指向該媒體文件的URL。 |
實例
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">
<channel>
<title>W3CSchool Home Page</title>
<link>http://www.w3cschool.cc</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3cschool.cc/rss</link>
<description>New RSS tutorial on W3CSchool</description>
<enclosure url="http://www.w3cschool.cc/media/3d.wmv"
length="78645" type="video/wmv" />
</item>
</channel>
</rss>
<rss version="2.0">
<channel>
<title>W3CSchool Home Page</title>
<link>http://www.w3cschool.cc</link>
<description>Free web building tutorials</description>
<item>
<title>RSS Tutorial</title>
<link>http://www.w3cschool.cc/rss</link>
<description>New RSS tutorial on W3CSchool</description>
<enclosure url="http://www.w3cschool.cc/media/3d.wmv"
length="78645" type="video/wmv" />
</item>
</channel>
</rss>
嘗試一下»
完整RSS參考手冊