|
Home >> FAQs/Tutorials >> RSS Tutorials >> Index
RSS FAQs - Atom Feed File Structure and Elements
By: FYIcenter.com
Part:
1
2
3
4
5
(Continued from previous part...)
How To Generate a Feed id Element?
The <id> element is a required sub-element of the <feed> element.
The Atom specification requires that you provide a universally unique identifier
for each of your feeds. So how to make this identifier universally unique?
One strategy is to use the URL where the feed document is located. For example,
if your Atom feed document is located at: http://dev.fyicenter.com/atom.xml,
you use the following id element in this feed document:
<id>http://dev.fyicenter.com/atom.xml</id>
How To Generate a Feed updated Element?
The <update> element is a required sub-element of the <feed> element.
The Atom specification requires that you provide a data and a time of when this feed was updated.
There is no problem to know the data and time for this element. But you need to pay attention
to the format of how the date and time should be specified.
Atom specification requires you to use the format defined in
RFC 3393 for the update element.
So you should one of the following two formats defined in RFC 3339:
- yyyy-mm-ddThh:mm:ss.ccZ, where T is a delimiter, and Z indicates this is a UTC time value.
For example: 2006-08-12T23:20:50.52Z.
- yyyy-mm-ddThh:mm:ss.cczzzzz, where T is a delimiter, and zzzzz is a time zone modifier like
-08:00, which is 8 hours behind UTC. For example: 2006-08-12T15:20:50.52-08:00.
How To Generate a Feed author Element?
The <author> element is not a required sub-element of the <feed> element.
However, it is required to have a feed author element, if one of the feed entries does not
have an author element. This requirement is to make sure that every feed entry has an author
information.
The <author> element is actually a container element, with 3 sub-elements defined as:
- <name> - Specifying the author's name. For example: Karl King. name is a required sub-element.
- <email> - Specifying the author's email address. For example: karl_king@fyicenter.com.
email is not a required sub-element.
- <uri> - Specifying the author's Web page, if exists. For example: http://www.fyicenter.com/karl_king.
url is not a required sub-element.
What Are Sub-elements of the entry Element?
The "entry" element has the following sub-elements defined:
- <author> - Specifying the personal information about an author of the contents provided in this feed entry.
A feed element may have zero, one or more author sub-elements.
- <category> - Specifying the category information of the contents provided in this feed entry.
A feed element may have zero, one or more category sub-elements.
- <content> - Specifying the content of this feed entry.
A feed element may have zero, or one content sub-element.
- <contributor> - Specifying the personal information about a contributor of the contents provided in this feed entry.
A feed element may have zero, one or more contributor sub-elements.
- <id> - Specifying a URI that universally and uniquely identifies this feed entry.
A feed element must exactly one id sub-element.
- <link> - Specifying a URL location of a Web page as a reference to this feed.
A feed element may have zero, one or more link sub-elements.
But if there is no content sub-element in a feed entry, at least one link sub-element with rel="alternate"
is required.
- <published> - Specifying a time stamp of when this feed entry was originally published
A feed element may have zero or one published sub-element.
- <rights> - Specifying the information about the copyrights for this feed.
A feed element may have zero or one rights sub-element.
- <source> - Specifying a feed entry in another feed document if this entry is a copy of that entry.
A feed element may have zero or one source sub-element.
- <summary> - Specifying a summary for this feed entry.
A feed element may have zero or one summary sub-element. However it is recommended that each
feed entry to have one summary sub-element.
- <title> - Specifying a title for this feed.
A feed element must have exactly one title sub-element.
- <updated> - Specifying a time stamp of when this feed was updated.
A feed element must have exactly one updated sub-element.
(Continued on next part...)
Part:
1
2
3
4
5
|