title: How do you add atom:link with rel="self" to an rss document?
body: <p>I am trying to create a dead simple rss feed. I validate my rss using <a href="https://validator.w3.org/feed/" rel="noreferrer">this</a> service form w3.org. Here is what my feed looks like:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rss version="2.0"&gt;
      &lt;channel&gt;
          &lt;title&gt;example.com RSS&lt;/title&gt;
          &lt;link&gt;https://www.example.com/&lt;/link&gt;
          &lt;description&gt;A cool website&lt;/description&gt;
          &lt;item&gt;
              &lt;title&gt;Cool Article&lt;/title&gt;
              &lt;link&gt;https://www.example.com/cool-article&lt;/link&gt;
              &lt;guid&gt;https://www.example.com/cool-article&lt;/guid&gt;
              &lt;pubDate&gt;Sun, 10 Dec 2017 05:00:00 GMT&lt;/pubDate&gt;
              &lt;description&gt;My cool article description&lt;/description&gt;
          &lt;/item&gt;
      &lt;/channel&gt;
  &lt;/rss&gt;
  </code></pre>
  
  <p>but I get this error from the feed validator: </p>
  
  <blockquote>
    <p>This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations.</p>
    
    <p>line 14, column 4: Missing atom:link with rel="self" [help]</p>
  </blockquote>
  
  <p>So I click on <a href="https://validator.w3.org/feed/docs/warning/SelfDoesntMatchLocation.html" rel="noreferrer">[help]</a> and get this:</p>
  
  <blockquote>
    <p>If you haven't already done so, declare the Atom namespace at the top of your feed, thus:</p>
    
    <p>
    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.</p>
    
    <p>&lt;atom:link href="http://dallas.example.com/rss.xml" rel="self" type="application/rss+xml" /></p>
  </blockquote>
  
  <p>Okay, first off I was trying to validate rss, <strong>not</strong> Atom but they seem to be trying to steer me in the direction of Atom. Okay, I'll try it anyhow.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"&gt;
      &lt;channel&gt;
          &lt;title&gt;example.com RSS&lt;/title&gt;
          &lt;link&gt;https://www.example.com/&lt;/link&gt;
          &lt;description&gt;A cool website&lt;/description&gt;
          &lt;atom:link href="http://www.example.com/rss.xml" rel="self" type="application/rss+xml" /&gt;
          &lt;item&gt;
              &lt;title&gt;Cool Article&lt;/title&gt;
              &lt;link&gt;https://www.example.com/cool-article&lt;/link&gt;
              &lt;guid&gt;https://www.example.com/cool-article&lt;/guid&gt;
              &lt;pubDate&gt;Sun, 10 Dec 2017 05:00:00 GMT&lt;/pubDate&gt;
              &lt;description&gt;My cool article description&lt;/description&gt;
          &lt;/item&gt;
      &lt;/channel&gt;
  &lt;/rss&gt;
  </code></pre>
  
  <p>Validate that and it gives you this error:</p>
  
  <blockquote>
    <p>Self reference doesn't match document location [help]</p>
  </blockquote>
  
  <p>So I click on <a href="https://validator.w3.org/feed/docs/warning/SelfDoesntMatchLocation.html" rel="noreferrer">[help]</a> and get this:</p>
  
  <blockquote>
    <p>Check the document referenced by the href attribute. If it is not the intended feed, correct it.</p>
    
    <p>This may not be a problem. At the current time, the feedvalidator does not probe to assess equivalence of documents.</p>
  </blockquote>
  
  <p>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.</p>