How To Generate a Feed link Element

Q

How To Generate a Feed link Element? - RSS FAQs - Atom Feed File Structure and Elements

✍: FYIcenter.com

A

The <link> element is not a required sub-element of the <feed> element. But it is strongly recommended that you provide a link element with rel="self" for each of your feed documents.

The rule for feed link element is simple. It needs two attributes:

  • rel="self" - Indicating that this link is providing the URL of this feed document itself.
  • href="/urlOfThisFeed" - Specifying the URL of this feed document.

For example, if you have a feed document located at http://dev.fyicenter.com/atom.xml, you should generate a feed link element like this:

 <link rel="self" href="http://dev.fyicenter.com/atom.xml"/>

2007-05-12, 4789👍, 0💬