Professional Documents
Culture Documents
How Do You Add Atom - Link With Rel - Self - To An Rss Document - Stack Overflow
How Do You Add Atom - Link With Rel - Self - To An Rss Document - Stack Overflow
How Do You Add Atom - Link With Rel - Self - To An Rss Document - Stack Overflow
I am trying to create a dead simple rss feed. I validate my rss using this service form w3.org.
Here is what my feed looks like:
11
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>example.com RSS</title>
1 <link>https://www.example.com/</link>
<item>
<title>Cool Article</title>
<link>https://www.example.com/cool-article</link>
<guid>https://www.example.com/cool-article</guid>
</item>
</channel>
</rss>
This feed is valid, but interoperability with the widest range of feed readers could be
improved by implementing the following recommendations.
If you haven't already done so, declare the Atom namespace at the top of your feed,
thus:
Then insert a atom:link to your feed in the channel section. Below is an example to get
you started. Be sure to replace the value of the href attribute with the URL of your
feed.
Okay, first off I was trying to validate rss, not Atom but they seem to be trying to steer me in
the direction of Atom. Okay, I'll try it anyhow.
<channel>
<item>
<title>Cool Article</title>
<link>https://www.example.com/cool-article</link>
<guid>https://www.example.com/cool-article</guid>
</item>
</channel>
</rss>
Check the document referenced by the href attribute. If it is not the intended feed,
correct it.
This may not be a problem. At the current time, the feedvalidator does not probe to
assess equivalence of documents.
And that's where I'm stuck. They don't say how to get it to do that. Do I get it to do that by
reading the atom specification and reimplementing my feed as Atom? Because I am not going
to do that.
rss
Oddly, <atom:link is still giving me issues with the validator: validator.w3.org/feed/… . Even with the
implementation of most of the suggestions below! (High-voted question with no high-voted answers,
eerie situation indeed!)
– HoldOffHunger
Dec 19 '21 at 1:54
You don't have to turn your feed from RSS to Atom to support atom:link .
5 To fix the problem, in the atom:link element, change the value of the href attribute to the
URL of your RSS feed. So if your RSS feed is at http://dallas.example.com/rss.xml, the atom:link
element
Join Stack shouldtobe
Overflow this:share knowledge, and build your career.
learn, Sign up
<atom:link href="http://dallas.example.com/rss.xml" rel="self"
type="application/rss+xml" />
Including an atom:link element in your RSS feed makes it more portable and easier to cache.
For more details, visit the RSS Best Practices Profile.
@Sjeiti Returns invalid when you actually run that .html in the actual W3.org Atom validator. (Your
link is only to the docs page.)
– HoldOffHunger
Dec 19 '21 at 1:52
As the message says the feed is valid. So you can proceed without making any changes to the
feed. None of my feeds have that link and they work perfectly well. The message is very old
3 and not accurate.
The validator is often wrong or confusing. I was generating an Atom document recently and
attempted to check with that tool, it started to advice me about missing tags from RSS... Get
3 rid of the atom:link tag that was suggested by the tool, it's for Atom document not RSS. I
would just double check with RSS specification instead of using the tool.
It's probably checking against Atom specification again. Even if it was a valid Atom document,
if you were pasting the xml content into the tool, you will get that message. It checks whether
whether the 'self' link in atom is same as the location the atom document is being served from.
There are great answers here already, and I'd guess that Dave Winer's answer is authoritative,
but for those of us who'd like to eliminate validation errors wherever possible…
2
This is
Join Stack likely a case
Overflow of mismatched
to learn, scheme
share knowledge, - in
and thisyour
build example,
career.the feed was likely requested
Sign up at
https://www.example.com/rss.xml, but atom:link specifies that the feed is to be found at
http://www.example.com/rss.xml.
<link>https://www.example.com/</link>
0 <atom10:link
xmlns:atom10="http://www.w3.org/2005/Atom"
rel="self"
type="application/rss+xml"
href="https://example.com/news.rss"
/>
The error message is not very informative when it tells you to add a <atom:link> , because it
should be telling you to add an <atom10:link> .
Join Stack Overflow to learn, share knowledge, and build your career. Sign up