|
Home >> FAQs/Tutorials >> RSS Tutorials >> Index
RSS FAQs - Atom Feed File Structure and Elements
By: FYIcenter.com
Part:
1
2
3
4
5
A collection of 15 FAQs on Atom feed file structure and elements. Clear answers are provided with tutorial samples on Atom feed documents and Atom entry documents; sub-elements of the feed and entry elements; generating contents for id, updated, and link sub-elements.
Topics included in this collection are:
- Are Atom Feed Files XML Documents?
- How Many Document Types Are Defined for Atom Feed Files?
- What Is the Structure of Atom Feed Documents?
- What Are Sub-elements of the feed Element?
- How To Generate a Feed title Element?
- How To Generate a Feed subtitle Element?
- How To Generate a Feed link Element?
- How To Generate a Feed id Element?
- How To Generate a Feed updated Element?
- How To Generate a Feed author Element?
- What Are Sub-elements of the entry Element?
- How To Generate a Feed Entry link Element?
- How To Generate a Feed title Element?
- How To Generate a Feed summary Element?
- Can One Atom Feed Document Have Multiple Entries?
Are Atom Feed Files XML Documents?
Yes. Atom feed files are XML (eXtensible Markup Language) documents. Atom feed files
must be well-formed XML documents, respecting the following XML rules.
- The first line must be the "xml" processing instruction with "version" and "encoding" attributes.
- There must be only one root element in a single XML document.
- All elements must be closed with the closing tags.
- One element can be nested inside another element.
- One element can not be partially nested inside another element.
- Element attribute values must be quoted with double quotes.
- Special characters in element attribute values or element contents must be protected using
entities, like < and >.
How Many Document Types Are Defined for Atom Feed Files?
There are 2 document types defined for Atom feed files:
- Atom Feed Document - Representing an Atom feed, including
metadata about the feed, and some or all of the entries associated
with it. Its root element is the <feed> element.
- Atom Entry Document - Representing only one Atom entry.
Its root element is the <entry> element.
What Is the Structure of Atom Feed Documents?
An Atom feed document must have a root element called "feed".
Within in the "feed" element, one or more "entry" elements are enclosed.
The high level structure of an Atom feed document looks like:
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
(other feed sub-elements)
<entry>
...
</entry>
<entry>
...
</entry>
(more entry elements)
</feed>
What Are Sub-elements of the feed Element?
The "feed" element has the following sub-elements defined:
- <author> - Specifying the personal information about an author of the contents provided in this feed.
A feed element may have zero, one or more author sub-elements.
- <category> - Specifying the category information of the contents provided in this feed.
A feed element may have zero, one or more category sub-elements.
- <contributor> - Specifying the personal information about a contributor of the contents provided in this feed.
A feed element may have zero, one or more contributor sub-elements.
- <generator> - Specifying the information about the software used to generate this feed.
A feed element may have zero or one generator sub-element.
- <icon> - Specifying the URL location of an icon image that identifies this feed.
A feed element may have zero or one icon sub-element.
- <logo> - Specifying the URL location of an logo image that identifies this feed.
A feed element may have zero or one logo sub-element.
- <id> - Specifying a URI that universally and uniquely identifies this feed.
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.
However, at least one link sub-element with rel="self" is recommended.
(Continued on next part...)
Part:
1
2
3
4
5
|