RSS - Entry Elements


Advertisements

An Atom Feed may contain one or more entry elements. Here's a list of the required and optional Feed elements.

Entry ID

This identifies the entry using a universally unique and permanent URI. Two entries in a feed can have the same value for id if they represent the same entry at different points in time.

Syntax

<id>http://example.com/blog/1234</id>

Required

Required.

Entry Title

This contains a human readable title for the entry. This value should not be blank.

Syntax

<title>Atom 1.0 Tutorial</title>

Required

Required.

Entry updation date

This indicates the last time the entry was modified in a significant way. This value need not change after a typo is fixed, only after a substantial modification. Generally, different entries in a Feed will have different updated timestamps.

Syntax

<updated>2007-07-13T18:30:02-05:00</updated>

Required

Required.

Entry Author

This names one author of the entry. An entry may have multiple authors. An entry must contain at least one author element unless there is an author element in the enclosing Feed, or there is an author element in the enclosed source element.

Syntax

<author>
   <name>Mohtashim</name>
</author>

Required

Optional, but recommended.

Entry Content

This contains or links to the complete content of the entry. Content must be provided if there is no alternate link, and should be provided if there is no summary.

Syntax

<content>complete story here</content>

Required

Optional, but recommended.

Entry link

This identifies a related Web page. The type of relation is defined by the rel attribute. An entry is limited to one alternate per type and hreflang. An entry must contain an alternate link if there is no content element.

Syntax

<link rel="alternate" href="/blog/1234"/>

Required

Optional, but recommended.

Entry summary

This conveys a short summary, abstract, or excerpt of the entry. Summary should be provided if there is either no content provided for the entry, or that content is not inline.

Syntax

<summary>Some text.</summary>

Required

Optional, but recommended.

Entry Category

This specifies a category that the entry belongs to. An entry may have multiple category elements.

Syntax

<category term="education"/>

Required

Optional.

Entry ontributor

This names one contributor to the entry. An entry may have multiple contributor elements.

Syntax

<contributor>
   <name>Mohtashim</name>
</contributor>

Required

Optional.

Published Tag

This contains the time of the initial creation or the first availability of the entry.

Syntax

<published>2007-07-13T09:17:51-08:00</published>

Required

Optional.

Entry source

If an entry is copied from one Feed into another Feed, then the source Feed's metadata (all child elements of Feed other than the entry elements) should be preserved if the source Feed contains any of the child elements author, contributor, rights, or category and those child elements are not present in the source entry.

Syntax:

<source>
   <id>http://moretutorials.org/</id>
   <title>Tutorials and Reference Manuals</title>
   <updated>2007-07-13T18:30:02Z</updated>
   <rights>© 2007 More Tutorials.</rights>
</source>

Required

Optional.

Entry rights

This conveys information about rights, e.g. copyrights, held in and over the entry.

Syntax

<rights type="html">© 2007 TutorialsPoint.com</rights>

Required

Optional.

Common Constructs

Category

<category> has one required attribute, term, and two optional attributes, scheme and label.

term identifies the category.

scheme identifies the categorization scheme via a URI.

label provides a human-readable label for display.

Content

<content> either contains, or links to, the complete content of the entry.

In the most common case, the type attribute is either text, html, xhtml, in which case the content element is defined identically to other text constructs.

Otherwise, if the src attribute is present, it represents the URI of where the content can be found. 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.

Link

<link> is patterned after html's link element. It has one required attribute, href, and five optional attributes: rel, type, hreflang, title, and length.

href is the URI of the referenced resource (typically a Web page).

rel contains a single link relationship type. It can be a full URI or one of the following predefined values (default=alternate):

  • alternate: An alternate representation of the entry or Feed, for example a permalink to the html version of the entry, or the front page of the weblog.
  • enclosure: A related resource, which is potentially large in size and might require special handling, for example an audio or video recording.
  • related: An document related to the entry or Feed.
  • self: The Feed itself.
  • via: The source of the information provided in the entry.

type indicates the media type of the resource.

hreflang indicates the language of the referenced resource.

title indicates the human readable information about the link, typically for display purposes.

length indicates the length of the resource, in bytes.

Person

<author> and <contributor> describes a person, corporation, or similar entity. It has one required element, name, and two optional elements: uri, email.

<name> conveys a human-readable name for the person.

<uri> contains a home page for the person.

<email> contains an email address for the person.

Text

<title>, <summary>, <content>, and <rights> contains human-readable text, usually in small quantities. The type attribute determines how this information is encoded (default="text").

If type="text", then this element contains plain text with no entity escaped html.

<title type="text">AT&amp;T bought by SBC!</title>

If type="html", then this element contains entity escaped html.

<title type="html">
   AT&amp;amp;T bought &lt;b&gt;by SBC&lt;/b&gt;!
</title>

If type="xhtml", then this element contains inline xhtml, wrapped in a div element.

<title type="xhtml">
   <div xmlns="http://www.w3.org/1999/xhtml">
      AT&amp;T bought <b>by SBC</b>!
   </div>
</title>

Atom 1.0 Example Feed

The example shows how to write a Feed using Atom 1.0.

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

   <title>Example Feed</title>
   <subtitle>Insert witty or insightful remark here</subtitle>
   <link href="http://example.org/"/>
   <updated>2003-12-13T18:30:02Z</updated>
   
   <author>
      <name>Mohtashim</name>
      <email>mohtashim@example.com</email>
   </author>
   
   <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
   
   <entry>
      <title>Tutorial on Atom</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>

Atom1.0 File Extension

A specific file-extension for an Atom 1.0 document is not required. But .xml is recommended.

what-is-atom.htm
Advertisements