Atom 1.0
<link>
A typed reference from a feed or entry to somewhere else — an empty element whose URL is in href, unlike RSS's <link>.
An Atom link is always empty and always carries its URL in href. The rel attribute says what kind of link it is: alternate for the human-readable version, self for the feed's own address, enclosure for media, via, related and others. rel defaults to alternate.
A feed should carry rel="self" so readers know where it lives, and each entry should carry rel="alternate" pointing at the article. Confusing this element with RSS's text-content <link> is the classic error when converting between the formats.
- Format
- Atom 1.0
- Namespace
- Atom Syndication Format 1.0
- How many
- Any number, on either the feed or an entry.
What it contains
Nothing — this element holds a value rather than other elements. Its content is text, and the constraints below are what that text has to be.
Attributes
hrefrequiredThe target IRI.reloptionalalternate (default), self, enclosure, via, related.typeoptionalMedia type of the target.hreflangoptionalLanguage of the target.
What our validator does
The feed's links are scanned for one with rel="self", and its absence is reported as a warning; other links are not inspected.
Broken and fixed
Both documents below are well-formed XML — that is the point of this corpus — and both are run through the validator on every test run. The verdicts here are what it returned, not what we expect it to.
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>urn:uuid:60a76c80-d399-11d9-b93c-0003939e0af6</id>
<title>Example</title>
<updated>2026-08-10T09:00:00Z</updated>
<author><name>Ada Lovelace</name></author>
<entry>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Hen lays egg</title>
<updated>2026-08-10T09:00:00Z</updated>
</entry>
</feed>No <link rel="self"> on the feed — RFC 4287 recommends one.<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>urn:uuid:60a76c80-d399-11d9-b93c-0003939e0af6</id>
<title>Example</title>
<updated>2026-08-10T09:00:00Z</updated>
<link rel="self" href="https://example.com/feed.xml"/>
<author><name>Ada Lovelace</name></author>
<entry>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<title>Hen lays egg</title>
<updated>2026-08-10T09:00:00Z</updated>
</entry>
</feed>Where it reaches
- NamespacesAtom Syndication Format 1.0The namespace, and the same element borrowed into RSS.
- Datatypesxs:anyURIThe type behind an href value.
Related elements
- <feed>The root element of an Atom document, and the one place the specification names three children as required rather than recommended.
- <entry>One item in an Atom feed, with the same three required children as the feed itself and an author requirement it can inherit.
- <link>The URL of the site, or of an item — and, in RSS, an element whose text content is the URL rather than an href attribute.
- <atom:link>An Atom element borrowed into RSS so a feed can name its own URL — the conventional way to declare rel="self".
Get started
Bring order to the XML your team can't afford to ignore.
Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.