HTML and CSS Reference
In-Depth Information
Subelements of the item Element
The item element has ten subelements:
author
,
category
,
comments
,
description
,
enclosure
,
guid
,
link
,
pubDate
,
source
, and
title
. All subelements are optional; however, at least a title or a description should be provided for each
item
element.
The author Subelement
The e-mail address of the author of the news feed item can be provided by the
author
subelement. Listing 8-17 shows
an example.
Listing 8-17.
The RSS Author
<author>info@example.com (John Smith)</author>
The category and pubDate Subelements
The syntax of the
category
and
pubDate
subelements of the
item
element is the same as that of the corresponding
subelements of the
channel
element (as discussed in earlier sections).
The comments Subelement
If there is a forum or blog that is related to a news entry (
item
element), a link to that page can be provided by the
comments
subelement of the
item
element. Listing 8-18 shows an example.
Listing 8-18.
Comments of an RSS Item
<comments>http://example.com/blog/new-standard-released/</comments>
The description Subelement
The texts of items (news summaries) are delimited by the
description
subelement, as shown in Listing 8-19.
Listing 8-19.
An RSS Item Description
<description>
Reports from workshop sessions
</description>
The enclosure Subelement
The
enclosure
subelement of the
item
element can be used to describe files (usually audio or video) related to the
news feed item. It has three required attributes:
url
(URL of the file),
length
(file size in bytes), and
type
(media type),
as demonstrated in Listing 8-20.
Listing 8-20.
An Enclosure
<enclosure url="http://example.com/download/words.mp3" length="4875577" type="audio/mpeg"/>
Search WWH ::
Custom Search