HTML and CSS Reference
In-Depth Information
The guid Subelement
Each RSS item might have a string that uniquely identifies it, called the
globally unique identifier
. The
guid
subelement has no specific syntax rules, but its content is usually a URL (Listing 8-21).
Listing 8-21.
A guid Specifying a Permalink Related to the News Entry
<item>
<title>New HTML5 and CSS3 Tutorials</title>
<link>
http://www.lesliesikos.com/tutorials/
<
/link>
<pubDate>Mon, 06 Feb 2012 14:22:00 +0930</pubDate>
<dc:creator>Dr. Leslie Sikos</dc:creator>
<category>Website</category>
<guid isPermaLink="true">
http://www.lesliesikos.com/tutorials/
<
/guid>
<description>Tutorials on HTML5 video embedding and CSS3 transitions</description>
<content:encoded>Several tutorials have recently been published on emerging
technologies such as HTML5 video embedding and CSS3 transitions.</content:encoded>
</item>
The
guid
subelement has an optional attribute,
isPermaLink
, that can be set to
true
or
false
. In the first case
(which is the default), the attribute value must be a URL that points to the full article or story described by the
item
element). The
false
value is rarely used. In fact, the whole
isPermaLink
attribute is often omitted.
■
the
guid
subelements, if provided, should be unique throughout the rSS file. this criterion might be difficult
to meet if the frequent updates of the same web site are described multiple times in the file.
Caution
The value of a
guid
subelement is considered a string by RSS readers.
■
although the
guid
subelement is optional, it is recommended to provide it for all
item
elements in order to
maximize interoperability.
Tip
The link Subelement
The URL of an item can be provided by the
link
subelement. Listing 8-22 shows an example.
Listing 8-22.
A Link Declared for an RSS Item
<link>http://example.com/news</link>
The source Subelement
If the item content comes from an external RSS channel, it can be provided by the
source
subelement. The value is the title
of the resource channel. The
source
element has one required attribute,
url
, which is the URL of the resource (Listing 8-23).
Listing 8-23.
The Source of an RSS Item
<source url="http://www.example.com/news.xml">John Smith Headlines</source>
Search WWH ::
Custom Search