Path

ez components / documentation / api reference / 2008.1beta1 / feed


eZ Components 2008.1beta1

Feed: Specifications

[ Tutorial ] [ Specifications ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Feed specifications

This document lists the various feed types supported by the Feed component, general information about each feed type, and the related specifications documents and RFCs.

Overview

Feeds equivalence

Feed elements

ezcFeed ATOM RSS1 RSS2
author !* author !* x managingEditor ?
category ?* category ?* x category ?*
cloud ? x x cloud ?
contributor ? contributor ?* x x
copyright ? rights ? x copyright ?
description ! subtitle ? description ! description !
docs ? x x docs ?
generator ? generator ? x generator ?
icon ? icon ? x x
id ! id ! about ! x
image ? logo ? image ? image ?
item !* entry ?* item !* item !*
language ? x x language ?
link !* link !* link ! link !
published ? x x pubDate ?
rating ? x x rating ?
skipDays ? x x skipDays ?
skipHours ? x x skipHours ?
textInput ? x textinput ? textInput ?
title ! title ! title ! title !
ttl ? x x ttl ?
updated ! updated ! x lastBuildDate ?
webMaster ? x x webMaster ?
! = required
? = optional
* = can appear multiple times
x = no equivalence

Item elements

ezcFeed ATOM RSS1 RSS2
author !* author !* x author ?
category ?* category ?* x category ?*
comments ? x x comments ?
content ? content ? x x
contributor ?* contributor ?* x x
copyright ? rights ? x x
description ! summary ! description ! description !
enclosure ? link ?* x enclosure ?
id ! id ! about ! guid ?
link !* link !* link ! link !
published ? published ? x pubDate ?
title ! title ! title ! title !
updated ! updated ! x x
! = required
? = optional
* = can appear multiple times
x = no equivalence

ezcFeed

Feed elements

ezcFeed-author

Type: array(ezcFeedPersonElement).

One author of the feed.

Required in ATOM: one author must be present at feed-level if there is one entry which does not have an author. Optional in RSS2 (recommended). Ignored for RSS1 feeds.

Multiple authors can appear in ATOM (not recommended). Can appear only once in RSS2 feeds.

ATOM has required elements: name. Optional elements: uri (ignored in RSS2) and email.

In RSS2 the generated XML element value will be email (name).

Create example:

// $feed is an ezcFeed object
$author = $feed->add( 'author' );
$author->name = 'Guybrush Threepwood';
$author->email = 'guybrush@monkey-island.com';
$author->uri = 'http://example.com/~guybrush'; // ATOM only

The resulting ATOM XML element will be:

<author>
  <name>Guybrush Threepwood</name>
  <email>guybrush@monkey-island.com</email>
  <uri>http://example.com/~guybrush</uri>
</author>

The resulting RSS2 XML element will be:

<managingEditor>guybrush@monkey-island.com (Guybrush Threepwood)</managingEditor>

Parse example:

$authors = array();

// $feed is an ezcFeed object
if ( isset( $feed->author ) )
{
    foreach ( $feed->author as $author )
    {
        $authors[] = array(
            'name' => isset( $author->name ) ? $author->name : null,
            'uri' => isset( $author->uri ) ? $author->uri : null, // ATOM only
            'email' => isset( $author->email ) ? $author->email : null // ATOM only
            );
    }
}

Equivalents: ezcFeed-author, ATOM-author, RSS1-none, RSS2-managingEditor.

ezcFeed-category

Type: array(ezcFeedCategoryElement).

A category for the feed.

Optional. Only ATOM and RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 feeds.

Multiple categories can appear in ATOM and RSS2 feeds.

ATOM has one required attribute: term. It also has 2 optional attributes: scheme (equivalent to RSS2 domain attribute), label. The label attribute will be ignored for RSS2 feeds.

RSS2 has one optional attribute: domain (equivalent to ATOM scheme attribute).

Create example:

// $feed is an ezcFeed object
$category = $feed->add( 'category' );
$category->term = 'holiday';
$category->scheme = 'http://example.com/categories/holiday'; // scheme = RSS2 domain
$category->label = 'Holiday'; // ATOM only

Parse example:

$categories = array();

// $feed is an ezcFeed object
if ( isset( $feed->category ) )
{
    foreach ( $feed->category as $category )
    {
        $categories[] = array(
            'term' => isset( $category->term ) ? $category->term : null,
            'scheme' => isset( $category->scheme ) ? $category->scheme : null,
                // scheme = RSS2 domain
            'label' => isset( $category->label ) ? $category->label : null // ATOM only
            );
    }
}

Equivalents: ezcFeed-category, ATOM-category, RSS1-none, RSS2-category.

ezcFeed-cloud

Type: ezcFeedCloudElement.

Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM.

Can appear only once.

Has the required attributes: domain, port, path, registerProcedure, protocol.

Create example:

// $feed is an ezcFeed object
$cloud = $feed->add( 'cloud' );
$cloud->domain = 'rpc.sys.com';
$cloud->port = 80;
$cloud->path = '/RPC2';
$cloud->registerProcedure = 'myCloud.rssPleaseNotify';
$cloud->protocol = 'xml-rpc';

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->cloud ) )
{
    $cloud = $feed->cloud;
    $domain = isset( $cloud->domain ) ? $cloud->domain : null;
    $port = isset( $cloud->port ) ? $cloud->port : null;
    $path = isset( $cloud->path ) ? $cloud->path : null;
    $procedure = isset( $cloud->registerProcedure ) ? $cloud->registerProcedure : null;
    $protocol = isset( $cloud->protocol ) ? $cloud->protocol : null;
}

Equivalents: ezcFeed-cloud, ATOM-none, RSS1-none, RSS2-cloud.

ezcFeed-contributor

Type: array(ezcFeedPersonElement).

One contributor of the feed.

Optional (not recommended). Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds.

Multiple contributors can appear.

Required elements: name. Optional elements: uri, email.

Create example:

// $feed is an ezcFeed object
$contributor = $feed->add( 'contributor' );
$contributor->name = 'Guybrush Threepwood';
$contributor->email = 'guybrush@monkey-island.com';
$contributor->uri = 'http://example.com/~guybrush';

Parse example:

$contributors = array();

// $feed is an ezcFeed object
if ( isset( $feed->contributor ) )
{
    foreach ( $feed->contributor as $contributor )
    {
        $contributors[] = array(
            'name' => isset( $contributor->name ) ? $contributor->name : null,
            'uri' => isset( $contributor->uri ) ? $contributor->uri : null,
            'email' => isset( $contributor->email ) ? $contributor->email : null
            );
    }
}

Equivalents: ezcFeed-contributor, ATOM-contributor, RSS1-none, RSS2-none.

ezcFeed-copyright

Type: ezcFeedTextElement.

Copyright information for the feed.

Optional. Only ATOM and RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 feeds.

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will be ignored for RSS1 and RSS2 feeds.

Create example:

// $feed is an ezcFeed object
$feed->copyright = 'Copyright <company name>';
$feed->copyright->type = 'text'; // ATOM only, ignored in RSS1 and RSS2
$feed->copyright->language = 'de'; // ATOM only, ignored in RSS1 and RSS2

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->copyright ) )
{
    $copyrightElement = $feed->copyright;
    $copyright = $copyrightElement->text;
    $type = isset( $copyrightElement->type ) ? $copyrightElement->type : null;  // ATOM only
    $language = isset( $copyrightElement->language ) ? $copyrightElement->language : null;  // ATOM only
}

Equivalents: ezcFeed-copyright, ATOM-rights, RSS1-none, RSS2-copyright.

ezcFeed-description

Type: ezcFeedTextElement.

A short description of the feed.

Required.

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will be ignored for RSS1 and RSS2 feeds.

Create example:

// $feed is an ezcFeed object
$feed->description = 'Feed description';
$feed->description->type = 'text'; // ATOM only, ignored in RSS1 and RSS2
$feed->description->language = 'de'; // ATOM only, ignored in RSS1 and RSS2

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->description ) )
{
    $descriptionElement = $feed->description;
    $description = $descriptionElement->text;
    $type = isset( $descriptionElement->type ) ? $descriptionElement->type : null; // ATOM only
    $language = isset( $descriptionElement->language ) ? $descriptionElement->language : null; // ATOM only
}

Equivalents: ezcFeed-description, ATOM-subtitle, RSS1-description, RSS2-description.

ezcFeed-docs

Type: ezcFeedTextElement.

An URL that points to the documentation for the format used in the feed file.

Optional. Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Create example:

// $feed is an ezcFeed object
$feed->docs = 'http://www.rssboard.org/rss-specification';

Parse example:

// $feed is an ezcFeed object
$docs = isset( $feed->docs ) ? $feed->docs->__toString() : null;

Equivalents: ezcFeed-docs, ATOM-none, RSS1-none, RSS2-docs.

ezcFeed-generator

Type: ezcFeedGeneratorElement.

Indicates the software used to generate the feed.

Optional. Only ATOM and RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 feeds.

Can appear only once.

ATOM has 2 optional attributes: url, version. These attributes are used in RSS2 to generate the string name version (url). This element and its attributes will be filled automatically by ezcFeed when generating the feed with the values eZComponents Feed, http://ezcomponents.org/docs/tutorials/Feed and <version> respectively, where the version is the current version of the Feed component (dev for pre-alpha1).

RSS2 will get this value automatically when generating the feed: eZ Components Feed <version> (http://ezcomponents.org/docs/tutorials/Feed), where the version is the current version of the Feed component (dev for pre-alpha1)

Create example - this is automatically done by ezcFeed when calling the generate() method:

// $feed is an ezcFeed object
$generator = $feed->add( 'generator' );
$generator->name = 'eZ Components Feed';
$generator->url = 'http://ezcomponents.org/docs/tutorials/Feed';
$generator->version = '1.0';

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->generator ) )
{
    $name = isset( $feed->generator->name ) ? $feed->generator->name : null;
    $url = isset( $feed->generator->url ) ? $feed->generator->url : null; // ATOM only
    $version = isset( $feed->generator->version ) ? $feed->generator->version : null; // ATOM only
}

Equivalents: ezcFeed-generator, ATOM-generator, RSS1-none, RSS2-generator.

ezcFeed-icon

Type: ezcFeedImageElement.

An icon for a feed, similar with favicon.ico for websites.

Optional. Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds.

Can appear only once.

Create example:

// $feed is an ezcFeed object
$feed->icon = 'http://example.com/favicon.ico';

Parse example:

// $feed is an ezcFeed object
$icon = isset( $feed->icon ) ? $feed->icon->__toString : null;

Equivalents: ezcFeed-icon, ATOM-icon, RSS1-none, RSS2-none.

ezcFeed-id

Type: ezcFeedIdElement.

A universally unique and permanent URI for a feed. For example, it can be an Internet domain name.

Required. Only RSS1 and ATOM feeds will have this element after generating the feed. It will be ignored for RSS2 feeds.

Can appear only once.

Create example:

// $feed is an ezcFeed object
$feed->id = 'ID value';

Parse example:

// $feed is an ezcFeed object
$id = isset( $feed->id ) ? $feed->id->__toString() : null;

Equivalents: ezcFeed-id, ATOM-id, RSS1-about, RSS2-none.

ezcFeed-image

Type: ezcFeedImageElement.

An image associated with the feed.

Optional.

Can appear only once.

RSS1 has the required attribute about, which should have the same value as the url sub-element.

RSS1 and RSS2 have 3 required sub-elements: title, link, url (same for both feed types). These attributes will be ignored for ATOM feeds.

RSS2 has 3 optional sub-elements: width, height, description. These attributes will be ignored for RSS1 and ATOM feeds.

Create example:

// $feed is an ezcFeed object
$image = $feed->add( 'image' );
$image->link = 'http://example.com/target_for_image_click.html';
$image->url = 'http://example.com/image.jpg'; // RSS1 and RSS2 only
$image->title = 'Click here to go to the link'; // RSS1 and RSS2 only
$image->width = 100; // RSS2 only
$image->height = 200; // RSS2 only
$image->description = 'This image is cool'; // RSS2 only
$image->about = 'http://example.com/image.jpg'; // RSS1 only

Parse example (RSS1 and RSS2):

// $feed is an ezcFeed object
if ( isset( $feed->image ) )
{
    $image = $feed->image;
    $link = isset( $image->link ) ? $image->link : null;
    $url = isset( $image->url ) ? $image->url : null; // RSS1 and RSS2 only
    $title = isset( $image->title ) ? $image->title : null; // RSS1 and RSS2 only
    $width = isset( $image->width ) ? $image->width : null; // RSS2 only
    $height = isset( $image->height ) ? $image->height : null; // RSS2 only
    $description = isset( $image->description ) ? $image->description : null; // RSS2 only
    $about = isset( $image->about ) ? $image->about : null; // RSS1 only
}

Equivalents: ezcFeed-image, ATOM-logo, RSS1-image, RSS2-image.

ezcFeed-item

Type: array(ezcFeedEntryElement).

Feed entry.

Required for RSS1 and RSS2 feeds. Optional (recommended) for ATOM feeds.

Multiple entries can appear.

Create example:

// $feed is an ezcFeed object
$item = $feed->add( 'item' );

// set $item properties, for example:
$item->title = 'Item title';

Parse example:

// $feed is an ezcFeed object
foreach ( $feed->item as $item )
{
    // get $item properties, for example:
    $title = isset( $item->title ) ? $item->title->__toString() : null;
}

Equivalents: ezcFeed-item, ATOM-entry, RSS1-item, RSS2-item.

ezcFeed-language

Type: ezcFeedTextElement.

The language for the feed.

Optional (recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

In ATOM you can assign the language to each element instead.

A list of allowed languages can be found here: RSS language codes.

Create example:

// $feed is an ezcFeed object
$feed->language = 'en';

Parse example:

// $feed is an ezcFeed object
$language = isset( $feed->language ) ? $feed->language->__toString() : null;

Equivalents: ezcFeed-language, ATOM-xml:lang for each element, RSS1-none, RSS2-language.

ezcFeed-link

Type: array(ezcFeedLinkElement).

An URL to the HTML website corresponding to the feed.

Required for all feed types. In ATOM a link back to the feed itself must be present (with rel="self").

Multiple links can appear in ATOM (not recommended).

Required attributes: href. Optional attributes for ATOM: rel (possible values: alternate (default), enclosure, related, self, via), type, hreflang, title, length.

A maximum of one link with rel="alternate" can appear per type and hreflang.

These attributes will be ignored for RSS1 and RSS2 feeds.

Create example:

// $feed is an ezcFeed object
$link = $feed->add( 'link' );
$link->href = 'http://example.com';
$link->rel = 'self'; // ATOM only
$link->type = 'text/html'; // ATOM only
$link->hreflang = 'en'; // ATOM only
$link->title = 'Link to the homepage'; // ATOM only
$link->length = 12345;  // ATOM only

Parse example:

$links = array();

// $feed is an ezcFeed object
foreach ( $feed->link as $link )
{
    $links[] = array(
        'href' => isset( $link->href ) ? $link->href : null,
        'rel' => isset( $link->rel ) ? $link->rel : null, // ATOM only
        'type' => isset( $link->type ) ? $link->type : null, // ATOM only
        'hreflang' => isset( $link->hreflang ) ? $link->hreflang : null, // ATOM only
        'title' => isset( $link->title ) ? $link->title : null, // ATOM only
        'length' => isset( $link->length ) ? $link->length : null, // ATOM only
        );
}

Equivalents: ezcFeed-link, ATOM-link, RSS1-link, RSS2-link.

ezcFeed-published

Type: ezcFeedDateElement.

The time the feed was published.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Can be assigned with an integer timestamp, a string date or a DateTime object.

Create example:

// $feed is an ezcFeed object
$feed->published = time();

Parse example:

// $feed is an ezcFeed object
$published = isset( $feed->published ) ? $feed->published->date->format( 'c' ) : null;

Other formats can be used also instead of 'c', see the documentation for date_format().

Equivalents: ezcFeed-published, ATOM-none, RSS1-none, RSS2-pubDate.

ezcFeed-rating

Type: ezcFeedTextElement.

The PICS rating for the channel.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Create example:

// $feed is an ezcFeed object
$feed->rating = '(PICS-1.1 "http://www.gcf.org/v2.5" labels
                  on "1994.11.05T08:15-0500"
                  exp "1995.12.31T23:59-0000"
                  for "http://www.greatdocs.com/foo.html"
                  by "George Sanderson, Jr."
                  ratings (suds 0.5 density 0 color/hue 1))';

Parse example:

// $feed is an ezcFeed object
$rating = isset( $feed->rating ) ? $feed->rating->__toString() : null;

Equivalents: ezcFeed-rating, ATOM-none, RSS1-none, RSS2-rating.

ezcFeed-skipDays

Type: ezcFeedSkipDaysElement.

A hint for aggregators telling them which days they can skip when reading the feed.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Can have up to 7 day elements, each with a value from Monday to Sunday.

Create example:

// $feed is an ezcFeed object
$skip = $feed->add( 'skipDays' );
$skip->days = array( 'Saturday', 'Sunday' );

Parse example:

// $feed is an ezcFeed object
$days = array( 'Monday' => false, /*...*/ 'Sunday' => false );
foreach ( $feed->skipDays->days as $skip )
{
    $days[$skip] = true;
}

Equivalents: ezcFeed-skipDays, ATOM-none, RSS1-none, RSS2-skipDays.

ezcFeed-skipHours

Type: ezcFeedSkipHoursElement.

A hint for aggregators telling them which hours they can skip when reading the feed.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Can have up to 24 hour elements, each with an integer value from 0 (midnight) to 23. The value 24 can also be used for midnight.

Create example:

// $feed is an ezcFeed object
$skip = $feed->add( 'skipHours' );
$skip->hours = array( 1, 2, 3, 4, 5 );

Parse example:

// $feed is an ezcFeed object
$hours = array( '0' => false, /*...*/ '24' => false );
foreach ( $feed->skipHours->hours as $skip )
{
    $hours[$skip] = true;
}

Equivalents: ezcFeed-skipHours, ATOM-none, RSS1-none, RSS2-skipHours.

ezcFeed-textInput

Type: ezcFeedTextInputElement.

Specifies a text input box that can be displayed with the feed.

Optional (not recommended). Only RSS1 and RSS2 feeds will have this element after generating the feed. It will be ignored for ATOM feeds.

Can appear only once.

For RSS1 it has the required attribute about, which should have the same value as the link sub-element.

Has four required sub-elements: title, description, name, link (same for RSS1 and RSS2).

Create example:

// $feed is an ezcFeed object
$textInput = $feed->add( 'textInput' );
$textInput->title = 'Text input title';
$textInput->description = 'Text input description';
$textInput->name = 'Text input name';
$textInput->link = 'Text input link';
$textInput->about = 'Text input link'; // RSS1 only, ignored in RSS2

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->textInput ) )
{
    $textInput = $feed->textInput;
    $title = isset( $textInput->title ) ? $textInput->title : null;
    $description = isset( $textInput->description ) ? $textInput->description : null;
    $name = isset( $textInput->name ) ? $textInput->name : null;
    $link = isset( $textInput->link ) ? $textInput->link : null;
    $about = isset( $textInput->about ) ? $textInput->about : null; // RSS1 only
}

Equivalents: ezcFeed-textInput, ATOM-none, RSS1-textinput, RSS2-textInput.

ezcFeed-title

Type: ezcFeedTextElement.

Human readable title for the feed. For example, it can be the same as the website title.

Required.

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will be ignored for RSS1 and RSS2 feeds.

Create example:

// $feed is an ezcFeed object
$feed->title = 'Feed title';
$feed->title->type = 'text'; // ATOM only, ignored in RSS1 and RSS2
$feed->title->language = 'de'; // ATOM only, ignored in RSS1 and RSS2

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->title ) )
{
    $element = $feed->title;
    $title = isset( $element->text ) ? $element->text : null;
    $type = isset( $element->type ) ? $element->type : null; // ATOM only
    $language = isset( $element->language ) ? $element->language : null; // ATOM only
}

Equivalents: ezcFeed-title, ATOM-title, RSS1-title, RSS2-title.

ezcFeed-ttl

Type: ezcFeedTextElement.

Number of minutes that indicates how long a channel can be cached before refreshing from the source.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored RSS1 and ATOM feeds.

Can appear only once.

Create example:

// $feed is an ezcFeed object
$feed->ttl = '60'; // minutes

Parse example:

// $feed is an ezcFeed object
$ttl = isset( $feed->ttl ) ? $feed->ttl->__toString() : null;

Equivalents: ezcFeed-ttl, ATOM-none, RSS1-none, RSS2-ttl.

ezcFeed-updated

Type: ezcFeedDateElement.

The last time the feed was updated.

Required for ATOM. Optional for RSS2. It will be ignored for RSS1 feeds. ezcFeed will add automatically the updated element with the value the current time in ATOM and RSS2 feeds.

Can appear only once.

Can be assigned with an integer timestamp, a string date or a DateTime object.

Create example:

// $feed is an ezcFeed object
$feed->updated = 'Tue, 10 Jun 2003 04:00:00 GMT';

Parse example:

// $feed is an ezcFeed object
$updated = isset( $feed->updated ) ? $feed->updated->date->format( 'c' ) : null;

Other formats can be used also instead of 'c', see the documentation for date_format().

Equivalents: ezcFeed-updated, ATOM-updated, RSS1-none, RSS2-lastBuildDate.

ezcFeed-webMaster

Type: ezcFeedPersonElement.

The email address of the webmaster responsible for the feed.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

It is a good practice to include the name and email of the webmaster, for example john.doe@example.com (John Doe).

Create example:

// $feed is an ezcFeed object
$webMaster = $feed->add( 'webMaster' );
$webMaster->name = 'John Doe';
$webMaster->email = 'john.doe@example.com';

Parse example:

// $feed is an ezcFeed object
if ( isset( $feed->webMaster ) )
{
    $name = isset( $feed->webMaster->name ) ? $feed->webMaster->name : null;
}

Equivalents: ezcFeed-webMaster, ATOM-none, RSS1-none, RSS2-webMaster.

Item elements

ezcFeed-item-author

Type: array(ezcFeedPersonElement).

One author of the feed entry.

Required in ATOM: one author must be present in each entry in case the feed does not contain an author. Optional in RSS2 (recommended). Ignored for RSS1 feeds.

Multiple authors can appear in ATOM (not recommended). Can appear only once in RSS2 feeds.

ATOM has required elements: name. Optional elements: uri (ignored in RSS2) and email.

In RSS2 the generated XML element value will be email (name).

Create example:

// $item is an ezcFeedEntryElement object
$author = $item->add( 'author' );
$author->name = 'Guybrush Threepwood';
$author->email = 'guybrush@monkey-island.com';
$author->uri = 'http://example.com/~guybrush'; // ATOM only

The resulting ATOM XML element will be:

<author>
  <name>Guybrush Threepwood</name>
  <email>guybrush@monkey-island.com</email>
  <uri>http://example.com/~guybrush</uri>
</author>

The resulting RSS2 XML element will be:

<author>guybrush@monkey-island.com (Guybrush Threepwood)</author>

Parse example:

$authors = array();

// $item is an ezcFeedEntryElement object
if ( isset( $item->author ) )
{
    foreach ( $item->author as $author )
    {
        $authors[] = array(
            'name' => isset( $author->name ) ? $author->name : null,
            'uri' => isset( $author->uri ) ? $author->uri : null, // ATOM only
            'email' => isset( $author->email ) ? $author->email : null // ATOM only
            );
    }
}

Equivalents: ezcFeed-item-author, ATOM-entry-author, RSS1-none, RSS2-item-author.

ezcFeed-item-category

Type: array(ezcFeedCategoryElement).

A category for the feed entry.

Optional. Only ATOM and RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 feeds.

Multiple categories can appear in ATOM and RSS2 feeds.

ATOM has one required attribute: term. Optional attributes: scheme (domain in RSS2) and label (ignored in RSS2).

Create example:

// $item is an ezcFeedEntryElement object
$category = $item->add( 'category' );
$category->term = 'holiday';
$category->scheme = 'http://example.com/categories/holiday'; // scheme = RSS2 domain
$category->label = 'Holiday'; // ATOM only

Parse example:

$categories = array();

// $item is an ezcFeedEntryElement object
if ( isset( $item->category ) )
{
    foreach ( $item->category as $category )
    {
        $categories[] = array(
            'term' => isset( $category->term ) ? $category->term : null,
            'scheme' => isset( $category->scheme ) ? $category->scheme : null, // scheme = RSS2 domain
            'label' => isset( $category->label ) ? $category->label : null // ATOM only
            );
    }
}

Equivalents: ezcFeed-item-category, ATOM-entry-category, RSS1-none, RSS2-item-category.

ezcFeed-item-comments

Type: ezcFeedTextElement.

A link to a webpage for comments.

Optional (not recommended). Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 and ATOM feeds.

Can appear only once.

Create example:

// $item is an ezcFeedEntryElement object
$item->comments = 'http://www.example.com/comments.php';

Parse example:

// $item is an ezcFeedEntryElement object
$comments = isset( $item->comments ) ? $item->comments->__toString() : null;

Equivalents: ezcFeed-item-comments, ATOM-none, RSS1-none, RSS2-item-comments.

ezcFeed-item-content

Type: ezcFeedContentElement.

A short description for the feed item.

Optional (not recommended). Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds. Can be substituted with description (recommended).

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml, or other mime values, depending on the data it contains.

Has an optional attribute src which specifies the URI where the full content is located.

Has an optional attribute xml:lang which specifies the language of the text. This attribute is accessed through ezcFeed as language. A list of allowed languages can be found here: RSS language codes.

If src is present, the type attribute, if present, is the media type of the content.

Otherwise, if the type attribute ends in +xml or /xml, then an XML document of this type is contained inline.

Otherwise, if the type attribute starts with text, then an escaped document of this type is contained inline.

Otherwise, a base64 encoded document of the indicated media type is contained inline.

Create example:

// $item is an ezcFeedEntryElement object
$item->content = 'Content';
$item->content->type = 'text';
$item->content->language = 'de';
$item->content->src = 'http://example.com/content_src.html';

Parse example:

// $item is an ezcFeedEntryElement object
if ( isset( $item->content ) )
{
    $contentElement = $item->content;
    $content = $descriptionElement->text;
    $type = isset( $contentElement->type ) ? $contentElement->type : null;
    $language = isset( $contentElement->language ) ? $contentElement->language : null;
    $src = isset( $contentElement->src ) ? $contentElement->src : null;
}

Equivalents: ezcFeed-item-content/ezcFeed-item-description, ATOM-entry-content, RSS1-none, RSS2-none.

ezcFeed-item-contributor

Type: array(ezcFeedPersonElement).

One contributor of the feed entry.

Optional (not recommended). Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds.

Multiple contributors can appear.

Required elements: name. Optional elements: uri, email.

Create example:

// $item is an ezcFeedEntryElement object
$contributor = $item->add( 'contributor' );
$contributor->name = 'Guybrush Threepwood';
$contributor->uri = 'http://example.com/~guybrush';
$contributor->email = 'guybrush@monkey-island.com';

Parse example:

$contributors = array();

// $item is an ezcFeedEntryElement object
if ( isset( $item->contributor ) )
{
    foreach ( $item->contributor as $contributor )
    {
        $contributors[] = array(
            'name' => isset( $contributor->name ) ? $contributor->name : null,
            'uri' => isset( $contributor->uri ) ? $contributor->uri : null,
            'email' => isset( $contributor->email ) ? $contributor->email : null
            );
    }
}

Equivalents: ezcFeed-item-contributor, ATOM-entry-contributor, RSS1-none, RSS2-none.

ezcFeed-item-copyright

Type: ezcFeedTextElement.

Copyright information for the feed entry.

Optional. Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds. For RSS2 the copyright is specified for the whole feed, not for any feed items (see ezcFeed-copyright).

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will be ignored for RSS1 and RSS2 feeds.

Create example:

// $item is an ezcFeedEntryElement object
$item->copyright = 'Copyright <company name>';
$item->copyright->type = 'text'; // ATOM only
$item->copyright->language = 'de'; // ATOM only

Parse example:

// $item is an ezcFeedEntryElement object
if ( isset( $item->copyright ) )
{
    $copyrightElement = $item->copyright;
    $copyright = $copyrightElement->text;
    $type = isset( $copyrightElement->type ) ? $copyrightElement->type : null; // ATOM only
    $language = isset( $copyrightElement->language ) ? $copyrightElement->language : null; // ATOM only
}

Equivalents: ezcFeed-item-copyright, ATOM-entry-rights, RSS1-none, RSS2-none (RSS2-copyright for the whole feed).

ezcFeed-item-description

Type: ezcFeedTextElement.

A short description of the feed item.

Required. In ATOM it can be substituted with ATOM-entry-content (not recommended) (see ezcFeed-item-content).

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will ignored for RSS1 and RSS2 feeds.

Create example:

// $item is an ezcFeedEntryElement object
$item->description = 'Feed description';
$item->description->type = 'text'; // ATOM only, ignored in RSS1 and RSS2
$item->description->language = 'de'; // ATOM only, ignored in RSS1 and RSS2

Parse example:

// $item is an ezcFeedEntryElement object
if ( isset( $item->description ) )
{
    $desc = $item->description;
    $description = $desc->text;
    $type = isset( $desc->type ) ? $desc->type : null; // ATOM only
    $language = isset( $desc->language ) ? $desc->language : null; // ATOM only
}

Equivalents: ezcFeed-item-description, ATOM-entry-summary, RSS1-item-description, RSS2-item-description.

ezcFeed-item-enclosure

Type: array(ezcFeedEnclosureElement).

A link to a multimedia file attached to the feed item.

Optional. Only RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1. For ATOM feeds the enclosure elements will be converted to ATOM-entry-link elements with the attribute rel="enclosure".

Can appear only once.

Has 3 required attributes: url, length, type.

Create example:

// $item is an ezcFeedEntryElement object
$enclosure = $item->add( 'enclosure' );
$enclosure->url = 'http://example.com/media/episode_001.mp3';
$enclosure->length = 49099054; // bytes
$enclosure->type = 'audio/x-mp3';

RSS2 output:

<enclosure url="http://example.com/media/episode_001.mp3" length="49099054" type="audio/x-mp3"/>

ATOM output:

<link href="http://example.com/media/episode_001.mp3" rel="enclosure" length="49099054" type="audio/x-mp3"/>

Parse example (RSS2):

// $item is an ezcFeedEntryElement object
if ( isset( $item->enclosure ) )
{
    $enclosure = $item->enclosure[0];
    $url = isset( $enclosure->url ) ? $enclosure->url : null;
    $length = isset( $enclosure->length ) ? $enclosure->length : null;
    $type = isset( $enclosure->type ) ? $enclosure->type : null;
}

Equivalents: ezcFeed-item-enclosure, ATOM-none (ATOM-entry-link for similar functionality), RSS1-none, RSS2-item-enclosure.

ezcFeed-item-id

Type: ezcFeedIdElement.

A unique identifier in respect to other id values of entries in the feed. It identifies the entry.

Required for ATOM and RSS1. Optional for RSS2 (recommended).

RSS2 has the optional attribute isPermLink. This attribute is ignored for RSS1 and ATOM.

Can appear only once.

Create example:

// $item is an ezcFeedEntryElement object
$item->id = 'ID value';
$item->id->isPermLink = false; // RSS2 only, it will be ignored for RSS1 and ATOM

Parse example:

// $item is an ezcFeedEntryElement object
if ( isset( $item->id ) )
{
    $id = isset( $feed->id->id ) : $feed->id->id : null;
    $isPermLink = isset( $feed->id->isPermLink ) ? $feed->id->isPermLink : null; // RSS2 only
}

Equivalents: ezcFeed-item-id, ATOM-entry-id, RSS1-item-about, RSS2-item-guid.

ezcFeed-item-link

Type: array(ezcFeedLinkElement).

A link to a resource related to the feed entry.

Required.

Multiple links can appear in ATOM (not recommended). Can appear only once in RSS1 and RSS2 feeds.

Enclosures of media files (used mainly for podcasts) can be added with this element. In RSS2 use ezcFeed-item-enclosure. RSS1 does not support enclosures.

ATOM has required attributes: href. Optional attributes: rel (possible values: alternate (default), enclosure, related, self, via), type, hreflang, title, length.

A maximum of one link with rel="alternate" can appear per type and hreflang.

Recommended only one rel="enclosure" link to keep compatibility with RSS2 enclosure.

These attributes are ignored for RSS1 and RSS2 feeds.

Create example:

// $item is an ezcFeedEntryElement object
$link = $item->add( 'link' );
$link->href = 'http://example.com';
$link->rel = 'self'; // ATOM only
$link->type = 'text/html'; // ATOM only
$link->hreflang = 'en'; // ATOM only
$link->title = 'Link to the article'; // ATOM only
$link->length = '20:14';  // ATOM only

Parse example:

$links = array();

// $item is an ezcFeedEntryElement object
foreach ( $item->link as $link )
{
    $links[] = array(
        'href' => isset( $link->href ) ? $link->href : null,
        'rel' => isset( $link->rel ) ? $link->rel : null, // ATOM only
        'type' => isset( $link->type ) ? $link->type : null, // ATOM only
        'hreflang' => isset( $link->hreflang ) ? $link->hreflang : null, // ATOM only
        'title' => isset( $link->title ) ? $link->title : null, // ATOM only
        'length' => isset( $link->length ) ? $link->length : null, // ATOM only
        );
}

Equivalents: ezcFeed-item-link/ezcFeed-item-enclosure, ATOM-entry-link, RSS1-item-link, RSS2-item-link/ RSS2-item-enclosure.

ezcFeed-item-published

Type: ezcFeedDateElement.

The time the feed item was published.

Optional (recommended). Only ATOM and RSS2 feeds will have this element after generating the feed. It will be ignored for RSS1 feeds.

Can appear only once.

Can be assigned with an integer timestamp, a string date or a DateTime object.

Create example:

// $item is an ezcFeedEntryElement object
$item->published = time();

Parse example:

// $item is an ezcFeedEntryElement object
$published = isset( $item->published ) ? $item->published->date->format( 'c' ) : null;

Equivalents: ezcFeed-item-published, ATOM-entry-published, RSS1-none, RSS2-item-pubDate.

ezcFeed-item-title

Type: ezcFeedTextElement.

Human readable title for the feed item.

Required.

Can appear only once.

ATOM has an optional attribute type with possible values text (default), html, xhtml. This attribute will be ignored for RSS1 and RSS2 feeds.

ATOM has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes. This attribute is accessed through ezcFeed as language. This attribute will be ignored for RSS1 and RSS2 feeds.

Create example:

// $item is an ezcFeedEntryElement object
$item->title = 'Feed title';
$item->title->type = 'text'; // ATOM only, ignored in RSS1 and RSS2
$item->title->language = 'de'; // ATOM only, ignored in RSS1 and RSS2

Parse example:

// $item is an ezcFeedEntryElement object
if ( isset( $item->title ) )
{
    $titleElement = $item->title;
    $title = $titleElement->text;
    $type = isset( $titleElement->type ) ? $titleElement->type : null; // ATOM only
    $language = isset( $titleElement->language ) ? $titleElement->language : null; // ATOM only
}

Equivalents: ezcFeed-item-title, ATOM-entry-title, RSS1-item-title, RSS2-item-title.

ezcFeed-item-updated

Type: ezcFeedDateElement.

The last time the feed entry was updated.

Required. Only ATOM feeds will have this element after generating the feed. It will be ignored for RSS1 and RSS2 feeds.

Can appear only once.

Can be assigned with an integer timestamp, a string date or a DateTime object.

Create example:

// $item is an ezcFeedEntryElement object
$item->updated = 'Tue, 10 Jun 2003 04:00:00 GMT';

Parse example:

// $item is an ezcFeedEntryElement object
$updated = isset( $item->updated ) ? $item->updated->date->format( 'c' ) : null;

Equivalents: ezcFeed-item-updated, ATOM-entry-updated, RSS1-none, RSS2-none.

Feed types

ATOM

Content type

All ATOM feeds should be identified with the application/atom+xml content type.

Structure

General information:
  • All elements must be in the http://www.w3.org/2005/Atom namespace
  • The top level element is called feed
  • All timestamps must conform to RFC 3339 (eg. 2003-12-13T18:30:02Z)
  • Unless otherwise specified, all values must be plain text
  • xml:lang may be used to identify the language of text (the property language for the ATOM elements rights, subtitle, title, content, rights, summary, title).
  • xml:base may be used to control how relative URIs are resolved (not recommended)

Sample ATOM feed:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>Example Feed</title>
  <link href="http://example.org/"/>
  <updated>2003-12-13T18:30:02Z</updated>
  <author>
    <name>John Doe</name>
  </author>
  <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>

  <entry>
    <title>Atom-Powered Robots Run Amok</title>
    <link href="http://example.org/2003/12/13/atom03"/>
    <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <summary>Some text.</summary>
  </entry>

</feed>

Feed elements

ATOM-author

One author of the feed.

Required: one author must be present unless all items contain at least one author.

Multiple authors can appear.

Required elements: name. Optional elements: uri, email.

Example:

<author>
  <name>John Doe</name>
  <uri>http://example.com/~johndoe</uri>
  <email>JohnDoe@example.com</email>
</author>

Equivalents: ezcFeed-author, ATOM-author, RSS1-none, RSS2-managingEditor.

ATOM-category

A category for the feed.

Optional.

Multiple categories can appear.

Has one required attribute: term. Has 2 optional attributes: scheme, label.

Equivalents: ezcFeed-category, ATOM-category, RSS1-none, RSS2-category.

ATOM-contributor

One contributor of the feed.

Optional (not recommended).

Multiple contributors can appear.

Required elements: name. Optional elements: uri, email.

Example:

<contributor>
  <name>John Doe</name>
  <uri>http://example.com/~johndoe</uri>
  <email>JohnDoe@example.com</email>
</contributor>

Equivalents: ezcFeed-contributor, ATOM-contributor, RSS1-none, RSS2-none.

ATOM-entry

Feed entry.

Optional (recommended).

Multiple entries can appear.

Equivalents: ezcFeed-item, ATOM-entry, RSS1-item, RSS2-item.

ATOM-generator

Indicates the software used to generate the feed.

Optional.

Can appear only once.

Has 2 optional attributes: url, version.

Equivalents: ezcFeed-generator, ATOM-generator, RSS1-none, RSS2-generator.

ATOM-icon

An icon for a feed, similar with favicon.ico for websites.

Optional.

Can appear only once.

Equivalents: ezcFeed-icon, ATOM-icon, RSS1-none, RSS2-none.

ATOM-id

A universally unique and permanent URI for a feed. For example, it can be an Internet domain name.

Required.

Can appear only once.

Equivalents: ezcFeed-id, ATOM-id, RSS1-about, RSS2-none.

ATOM-link

An URL to the HTML website corresponding to the feed.

Required: a link back to the feed itself must be present (with rel="self").

Multiple links can appear.

Required attributes: href. Optional attributes: rel (possible values: alternate (default), enclosure, related, self, via), type, hreflang, title, length.

A maximum of one link with rel="alternate" can appear per type and hreflang.

Equivalents: ezcFeed-link, ATOM-link, RSS1-link, RSS2-link.

An image associated with the feed. The value is an URL to an image.

Optional.

Can appear only once.

Equivalents: ezcFeed-image, ATOM-logo, RSS1-image, RSS2-image.

ATOM-rights

Copyright information for the feed.

Optional.

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-copyright, ATOM-rights, RSS1-none, RSS2-copyright.

ATOM-subtitle

A short description of the feed.

Optional (recommended).

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-description, ATOM-subtitle, RSS1-description, RSS2-description.

ATOM-title

Human readable title for the feed. For example, it can be the same as the website title.

Required.

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-title, ATOM-title, RSS1-title, RSS2-title.

ATOM-updated

The last time the feed was updated.

Required.

Can appear only once.

Must conform to RFC 3339 (eg. 2003-12-13T18:30:02Z).

Equivalents: ezcFeed-updated, ATOM-updated, RSS1-none, RSS2-lastBuildDate.

Item elements

ATOM-entry-author

One author of the feed entry.

Required: one author must be present in each entry in case the feed does not contain an author.

Multiple authors can appear.

Required elements: name. Optional elements: uri, email.

Example:

<author>
  <name>John Doe</name>
  <uri>http://example.com/~johndoe</uri>
  <email>JohnDoe@example.com</email>
</author>

Equivalents: ezcFeed-item-author, ATOM-entry-author, RSS1-none, RSS2-item-author.

ATOM-entry-category

A category for the feed entry.

Optional.

Multiple categories can appear.

Has one required attribute: term. Has 2 optional attributes: scheme, label.

Equivalents: ezcFeed-item-category, ATOM-entry-category, RSS1-none, RSS2-item-category.

ATOM-entry-content

A short description for the feed item.

Optional (not recommended). It is required if summary is absent). Can be substituted with summary (recommended).

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml, or other mime values, depending on the data it contains.

Has an optional attribute src which specifies the URI where the full content is located.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

If src is present, the type attribute, if present, is the media type of the content.

Otherwise, if the type attribute ends in +xml or /xml, then an XML document of this type is contained inline.

Otherwise, if the type attribute starts with text, then an escaped document of this type is contained inline.

Otherwise, a base64 encoded document of the indicated media type is contained inline.

Equivalents: ezcFeed-item-description, ATOM-entry-summary/ ATOM-entry-content, RSS1-item-description, RSS2-item-description.

ATOM-entry-contributor

One contributor of the feed entry.

Optional (not recommended).

Multiple contributors can appear.

Required elements: name. Optional elements: uri, email.

Example:

<contributor>
  <name>John Doe</name>
  <uri>http://example.com/~johndoe</uri>
  <email>JohnDoe@example.com</email>
</contributor>

Equivalents: ezcFeed-item-contributor, ATOM-entry-contributor, RSS1-none, RSS2-none.

ATOM-entry-id

A unique identifier in respect to other id values of entries in the feed. It identifies the entry.

Required.

Can appear only once.

Equivalents: ezcFeed-item-id, ATOM-entry-id, RSS1-item-about, RSS2-item-guid.

ATOM-entry-link

A link to a resource related to the feed entry.

Required.

Multiple links can appear.

Required attributes: href. Optional attributes: rel (possible values: alternate (default), enclosure, related, self, via), type, hreflang, title, length.

A maximum of one link with rel="alternate" can appear per type and hreflang.

Recommended only one rel="enclosure" link to keep compatibility with RSS2 enclosure.

Equivalents: ezcFeed-item-link/ezcFeed-item-enclosure, ATOM-entry-link, RSS1-item-link, RSS2-item-link/ RSS2-item-enclosure.

ATOM-entry-published

The time the feed item was published.

Optional (recommended).

Can appear only once.

Must conform to RFC 3339 (eg. 2003-12-13T18:30:02Z).

Equivalents: ezcFeed-item-published, ATOM-entry-published, RSS1-none, RSS2-item-pubDate.

ATOM-entry-rights

Copyright information for the feed entry.

Optional.

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-item-copyright, ATOM-entry-rights, RSS1-none, RSS2-none (RSS2-copyright for the whole feed).

ATOM-entry-summary

A short description for the feed item.

Required. Can be substituted with content (not recommended).

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-item-description, ATOM-entry-summary/ ATOM-entry-content, RSS1-item-description, RSS2-item-description.

ATOM-entry-title

A title for the feed item.

Required.

Can appear only once.

Has an optional attribute type with possible values text (default), html, xhtml.

Has an optional attribute xml:lang which specifies the language of the text. A list of allowed languages can be found here: RSS language codes.

Equivalents: ezcFeed-item-title, ATOM-entry-title, RSS1-item-title, RSS2-item-title.

ATOM-entry-updated

The last time the feed entry was updated.

Required.

Can appear only once.

Must conform to RFC 3339 (eg. 2003-12-13T18:30:02Z).

Equivalents: ezcFeed-item-updated, ATOM-entry-updated, RSS1-none, RSS2-none.

RSS1

Specifications

RSS1 = RDF Site Summary RDF = Resource Description Framework

RSS1 specifications

Content type

All RSS1 feeds should be identified with the application/rss+xml content type (not a standard yet).

Structure

Sample RSS1 feed:

<?xml version="1.0"?>

<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/">

  <channel rdf:about="http://www.xml.com/xml/news.rss">
    <title>XML.com</title>
    <link>http://xml.com/pub</link>
    <description>
      XML.com features a rich mix of information and services
      for the XML community.
    </description>

    <image rdf:resource="http://xml.com/universal/images/xml_tiny.gif" />

    <items>
      <rdf:Seq>
        <rdf:li resource="http://xml.com/pub/2000/08/09/xslt/xslt.html" />
        <rdf:li resource="http://xml.com/pub/2000/08/09/rdfdb/index.html" />
      </rdf:Seq>
    </items>

  </channel>

  <image rdf:about="http://xml.com/universal/images/xml_tiny.gif">
    <title>XML.com</title>
    <link>http://www.xml.com</link>
    <url>http://xml.com/universal/images/xml_tiny.gif</url>
  </image>

  <item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html">
    <title>Processing Inclusions with XSLT</title>
    <link>http://xml.com/pub/2000/08/09/xslt/xslt.html</link>
    <description>
     Processing document inclusions with general XML tools can be
     problematic. This article proposes a way of preserving inclusion
     information through SAX-based processing.
    </description>
  </item>

  <item rdf:about="http://xml.com/pub/2000/08/09/rdfdb/index.html">
    <title>Putting RDF to Work</title>
    <link>http://xml.com/pub/2000/08/09/rdfdb/index.html</link>
    <description>
     Tool and API support for the Resource Description Framework
     is slowly coming of age. Edd Dumbill takes a look at RDFDB,
     one of the most exciting new RDF toolkits.
    </description>
  </item>

</rdf:RDF>

Feed elements

RSS1-about

A universally unique and permanent URI for a feed. For example, it can be an Internet domain name.

Required.

Can appear only once.

Equivalents: ezcFeed-id, ATOM-id, RSS1-about, RSS2-none.

RSS1-description

A short description of the feed.

Required.

Can appear only once.

Equivalents: ezcFeed-description, ATOM-subtitle, RSS1-description, RSS2-description.

RSS1-image

An image associated with the feed.

Optional.

Can appear only once.

Has the required attribute about, which should have the same value as the url sub-element.

Has 3 required sub-elements: title, link, url.

Equivalents: ezcFeed-image, ATOM-logo, RSS1-image, RSS2-image.

RSS1-item

A feed entry.

Required.

Multiple entries can appear.

Equivalents: ezcFeed-item, ATOM-entry, RSS1-item, RSS2-item.

RSS1-link

The URL to the HTML website corresponding to the feed.

Required.

Can appear only once.

Equivalents: ezcFeed-link, ATOM-link, RSS1-link, RSS2-link.

RSS1-textinput

Specifies a text input box that can be displayed with the feed.

Optional (not recommended).

Can appear only once.

Has the required attribute about, which should have the same value as the link sub-element.

Has four required sub-elements: title, description, name, link.

Equivalents: ezcFeed-textInput, ATOM-none, RSS1-textinput, RSS2-textInput.

RSS1-title

Human readable title for the feed. For example, it can be the same as the website title.

Required.

Can appear only once.

Equivalents: ezcFeed-title, ATOM-title, RSS1-title, RSS2-title.

Item elements

RSS1-item-about

A unique identifier in respect to other about values in the feed. It identifies the item. Should be identical to the link value of the item, if possible.

Required.

Can appear only once.

Equivalents: ezcFeed-item-id, ATOM-entry-id, RSS1-item-about, RSS2-item-guid.

RSS1-item-description

A short description of the feed item.

Required.

Can appear only once.

Equivalents: ezcFeed-item-description, ATOM-entry-summary, RSS1-item-description, RSS2-item-description.

RSS1-item-link

The URL to the HTML website corresponding to the feed item.

Required.

Can appear only once.

Equivalents: ezcFeed-item-link, ATOM-entry-link, RSS1-item-link, RSS2-item-link.

RSS1-item-title

A title for the feed item.

Required.

Can appear only once.

Equivalents: ezcFeed-item-title, ATOM-entry-title, RSS1-item-title, RSS2-item-title.

RSS2

Specifications

RSS2 = Really Simple Syndication

RSS2 specifications

Content type

All RSS2 feeds should be identified with the application/rss+xml content type (not a standard yet).

Structure

Sample RSS2 feed:

<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Liftoff News</title>
  <link>http://liftoff.msfc.nasa.gov/</link>
  <description>Liftoff to Space Exploration.</description>
  <language>en-us</language>
  <pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
  <webMaster>webmaster@example.com</webMaster>
  <item>
	<title>The Engine That Does More</title>
	<link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>
	<description>Before man travels to Mars, NASA hopes to design new engines
	that will let us fly through the Solar System more quickly. The proposed
	VASIMR engine would do that.</description>
	<pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>
	<guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>
  </item>
  <item>
	<title>Astronauts' Dirty Laundry</title>
	<link>http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</link>
	<description>Compared to earlier spacecraft, the International Space Station
	has many luxuries, but laundry facilities are not one of them. Instead,
	astronauts have other options.</description>
	<pubDate>Tue, 20 May 2003 08:56:02 GMT</pubDate>
	<guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>
  </item>
</channel>
</rss>

Feed elements

RSS2-category

A category for the feed.

Optional.

Multiple categories can appear.

Has one optional attribute: domain.

The value of the category element must be specified.

Equivalents: ezcFeed-category, ATOM-category, RSS1-none, RSS2-category.

RSS2-cloud

Allows processes to register with a cloud to be notified of updates to the channel, implementing a lightweight publish-subscribe protocol for RSS feeds.

Optional (not recommended).

Can appear only once.

Has the required attributes: domain, port, path, registerProcedure, protocol.

Example:

<cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="myCloud.rssPleaseNotify" protocol="xml-rpc" />

Equivalents: ezcFeed-cloud, ATOM-none, RSS1-none, RSS2-cloud.

RSS2-copyright

Copyright information for the feed.

Optional.

Can appear only once.

Equivalents: ezcFeed-copyright, ATOM-rights, RSS1-none, RSS2-copyright.

RSS2-description

A short description of the feed.

Required.

Can appea