Creating RSS files for your Web site (2/5) - exploring XML | WebReference

Creating RSS files for your Web site (2/5) - exploring XML

Creating RSS files for your Web site

Channels

The <channel> element has several required and optional sub-elements, listed in the table below:

<!ELEMENT channel (title | description | link | language | item+ | rating? | image? | textinput? | copyright? | pubDate? | lastBuildDate? | docs? | managingEditor? | webMaster? | skipHours? | skipDays?)*>
Required <channel> sub-elements
<!ELEMENT title (#PCDATA)> The name of the channel. It's how people refer to your service. If you have an HTML website that contains the same information as your RSS file, the title of your channel should be the same as the title of your website. Maximum length is 100 characters.
<!ELEMENT link (#PCDATA)> A URL pointing to the website named in the <title>. Maximum length is 500 characters.
<!ELEMENT description (#PCDATA)> A phrase that describes your channel, your channel's positioning statement. Maximum length is 500 characters.

<!ELEMENT language (#PCDATA)> Indicates the language your channel is written in. This allows aggregators to group all Italian language sites, for example, on a single page. A list of allowable values for this element is here.

<!ELEMENT image>An XML element that contains several sub-elements, explained here.
Optional <channel> sub-elements
<!ELEMENT copyright (#PCDATA)> Copyright notice for content in the channel. Maximum length is 100.
<!ELEMENT managingEditor (#PCDATA)> The email address of the managing editor of the channel, the person to contact for editorial inquiries. Maximum length is 100. The suggested format for email addresses in RSS elements is [email protected] (Bull Mancuso).
<!ELEMENT webMaster (#PCDATA)> The email address of the webmaster for the channel, the person to contact if there are technical problems. Maximum length is 100.
<!ELEMENT rating (#PCDATA)> The PICS rating for the channel. Maximum length is 500.
<!ELEMENT pubDate (#PCDATA)> The publication date for the content in the channel. For example, the New York Times publishes on a daily basis, the publication date flips once every 24 hours. That's when the pubDate of the channel changes. All date-times in RSS conform to the Date and Time Specification of RFC 822.
<!ELEMENT lastBuildDate (#PCDATA)> The date-time of the last time the content of the channel changed.
<!ELEMENT docs (#PCDATA)> A URL that points to the documentation for the format used in the RSS file. It's probably a pointer to this page. It's for people who might stumble across an RSS file on a Web server 25 years from now and wonder what it is. Maximum length is 500.
<!ELEMENT textInput>An XML element that contains several sub-elements, explained below.
<!ELEMENT skipDays (day+)> An XML element that contains up to seven <day> sub-elements whose value is Monday, Tuesday, Wednesday, Thursday, Friday, Saturday or Sunday. Aggregators may not read the channel during hours listed in the skipDays element. (Most aggregators seem to ignore this element.)
<!ELEMENT skipHours (hour+)> An XML element that contains up to 24 <hour> sub-elements whose value is a number between 1 and 24, representing a time in GMT, when aggregators, if they support the feature, may not read the channel on days listed in the skipHours element. (Most aggregators seem to ignore this element.)

Here you can notice one of the shortcomings of DTDs: All basic elements in this DTD are of type #PCDATA, whether they are supposed to be strings, numbers, or times. Additional specifications, such as the format and timezone of a time value, can only be expressed in the explanatory text above. XML Schema tries to improve on that as mentioned in column12.

More on RSS items and images.

https://www.internet.com

Produced by Michael Claßen
All Rights Reserved. Legal Notices.

URL: https://www.webreference.com/xml/column13/2.html
Created: Jun 18, 2000
Revised: Jun 18, 2000