HTML and CSS Reference
In-Depth Information
The title Subelement
The titles of RSS channel items can be declared by the
title
subelement of the
item
element. Listing 8-24 shows an
example.
Listing 8-24.
The Title of an RSS Item
<title>A new W3C standard</title>
Namespaces
The default namespace for RSS is
http://purl.org/rss/1.0/
, which is the
permanent URL
form of the RDF Site
Summary (RSS) 1.0 namespace,
http://web.resource.org/rss/1.0/
. The namespace can be provided in the form
presented in Listing 8-25.
Listing 8-25.
Declaring the RSS Namespace
<rss version="2.0" xmlns:rss="
http://purl.org/rss/1.0/
">
Additional data on channel updates can be provided by the
web syndication namespace of RSS
sy:updatePeriod
element. Allowed values are
hourly
,
daily
,
weekly
,
monthly
, and
yearly
. If omitted,
daily
is
assumed.
•
The period over which the news channel is updated can be described by the
•
The frequency of updates can be expressed in relation to the update period with the
sy:updateFrequency
element. Its value is a positive integer.
sy:updateBase
element. It should be a #PCDATA date in one of the W3C date and time formats [16].
•
To calculate the publishing schedule, a base date can be defined by the
By default, news feed entries are plain-text contents. However, news aggregators often support (X)HTML
markup that are not allowed in XML. Entity-encoded and CDATA-escaped contents can be provided with the
content:encoded
element is especially useful if the hyperlink delimited by the
link
element is not enough and
additional hyperlinks are needed (in the news item content). Although text formatting and other markup codes can
also be written this way, they are ignored by many RSS readers.
There is an element,
atom:link
, that can be used from another syndication format, Atom, to provide the
self-link of the news feed channel. To apply this element, the Atom namespace
http://www.w3.org/2005/Atom
should be declared.
Advanced news feeds typically contain at least the namespace declarations presented in Listing 8-26.
Listing 8-26.
Typical Namespace Declarations in RSS
<rss version="2.0"
xmlns:content="
http://purl.org/rss/1.0/modules/content/
"
xmlns:dc="
http://purl.org/dc/elements/1.1/
"
xmlns:sy="
http://purl.org/rss/1.0/modules/syndication/
"
xmlns:atom="
http://www.w3.org/2005/Atom
"
>
Search WWH ::
Custom Search