HTML and CSS Reference
In-Depth Information
Similarly, further styles can be set for other RSS elements. Much information is not always relevant and can be
omitted, as for example in Listing 8-32.
Listing 8-32. Hiding RSS Elements with CSS
channel link, channel language, channel copyright, channel managingEditor,
channel webMaster, channel docs, channel lastBuildDate {
display: none;
The second approach applies XSL Transformation, which provides more control. For example, hyperlinks can be
activated, and node order can be changed. The XSL file can be linked as shown in Listing 8-33.
Listing 8-33. Using XSLT for Styling RSS
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="css/feed.xsl" ?>
<rss version="2.0">
additional functionality such as searching or category listings provided by the built-in rSS reader of some
browsers are not available when a custom style sheet is applied to a news feed.
The Atom news feed specification consists of two standards: the Atom Syndication Format and the Atom Publishing
Protocol (AtomPub or APP). The first one is a web feed format in XML syntax defined by an IETF proposed standard
(RFC 4287 [17]). The second one is an HTTP-based protocol that can be used for creating and updating web resources.
It is also a proposed standard (RFC 5023 [18]). This section focuses on the Atom Syndication Format.
The file extensions of Atom feeds are .atom and .xml . The Internet media type of Atom is application/atom+xml .
The Atom namespace is .
Creating an Atom File
Atom files begin with an XML declaration. The root element of Atom files and the container of news feed entries
( entry elements) is the feed element. Listing 8-34 shows the general structure of an Atom file.
Listing 8-34. General Structure of an Atom File
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns=" " >
<title>An Atom news feed example</title>
<link rel="alternate" type="text/html" href="" />
<link rel="self" type="application/atom+xml" href="" />
<title>News item 2</title>
<link rel="alternate" type="text/html" href="" />
Search WWH ::

Custom Search