..
In a previous article we introduced the RSS format , an XML-based, introducing the structure of the standard RSS (which stands for Really Simple Sindacation) for the exchange of information between different Web applications
Let us examine here the RSS format RSS 2.0 or more precisely 2.
It is always a format based on a standard XML structure as that of the feed of news centre-equestre-lepuy.com, available at:
Consider the structure just indicated, semplifichiamola-level code and see every single tag that is the purpose of:
<? Xml version = "1.0" encoding = "ISO-8859-1"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title> MioSito.ext - News Online </ title>
<link> http://www.miosito.ext/news/ </ link>
<description> News of the Web MioSito.ext cra </ description>
<language> en </ language>
<lastBuildDate> 01/04/2008 13:06:54 </ lastBuildDate>
<image>
<url> http://www.miosito.ext/logo_news.gif </ url>
<title> MioSito.ext - News Online </ title>
<link> http://www.miosito.ext/news/ </ link>
</ Image>
<item>
<title> <! [CDATA [Title of the news ]]></ title>
<link> http://www.miosito.ext/notizia.asp?id=123 </ link>
<description> <! [CDATA [Brief Description ...
]]></ Description>
<author> MioSito.ext </ author>
<pubDate> Tues, 01 Apr 2008 GMT </ pubDate>
<category domain="http://www.miosito.ext/categoria.asp?id=5"> Name Category </ category>
<GUID isPermaLink="true"> http://www.miosito.ext/notizia.asp?id=123 </ guid>
</ Item>
</ Channel>
</ Rss>
It is a basic form of RSS 2.0 but tags are available to many more, so we start looking at used ones, starting from the basic structure.
The basic structure used primarily sees the xml header, then the rss tag that contains attributes that specifies the URL of his official namespaces, and then the channel tag that will contain data files of all the RSS feeds.
The channel consists of three parts:
By virtue of what is listed in the previous paragraph, we see that the element channel sees in all the RSS feeds, so it might sound silly to talk about thinking as an element in its own right.
In order dui discuss all the elements that go directly specified in the channel, referring to after the compulsory and optional elements and image items.
The following is a detailed list of required tags of the channel element.
There is no doubt that the XML file must be drawn respecting the semantic rules of XML itself, or handle special characters and other potentially annoying and hazardous aspects in relation to the integrity of the XML file in question.
However, especially in the field of news, it can happen often be faced with difficult to manage exceptions that would send the XML file in error and consequently the script that remotely read it to display the feed.
The problem is simply controlled through the CDATA command, once the XML file is the best managed, manages exceptions unmanageable in terms of character and potential small but crucial errors.
The code example shown above explains, at a practical level, how to integrate it within the XML tags:
<title> <b> <! [CDATA [</ b> Title of the news <b> ]]></ b> </ title>I have highlighted in bold code to make it more distinguishable CDATA when reading and learning of the concept in question in this section.
| |
CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €. |
| |
XML (Course)
Creation of XML structures, XSL and other languages extensible. Starting from 29 €. |