RSS 2.0
What goes wrong in RSS 2.0
The 17 errors this corpus records against RSS 2.0 documents, keyed by the message your parser printed. Nothing here is written for this page — each error declares the formats it bites, and this is that declaration read the other way round.
Start with the message you were given
Every entry below states the message our validator emits, verbatim, and a test asserts it still does. If you are holding a broken document rather than a question, RSS & Atom feed validator will tell you which of these you have.Parse errors · 17
These stop the document being read at all. Nothing downstream sees a file with one of them, because it is not XML.
- Opening and ending tag mismatch
Opening and ending tag mismatch: item line 2 and channel (line 4)An element was closed out of order: the parser met an end tag for an ancestor while a child was still open, so the tree cannot be built at all. - Premature end of data in tag
Premature end of data in tag urlset line 1 (line 2)The document ended while one or more elements were still open — almost always truncation, not an authoring mistake. - Extra content at the end of the document
Extra content at the end of the document (line 2)Something follows the root element — a second root, a stray closing tag, or a fragment that was never a whole document. - Unescaped ampersand (EntityRef: expecting ';')
EntityRef: expecting ';' (line 2)A bare & appeared in content. XML reads it as the start of an entity reference and expects a name and a semicolon. - Entity is not defined
Entity 'nbsp' not defined (line 1)An HTML entity was used in XML. Only five are predefined; anything else must be declared in a DTD or written as a numeric character reference. - Start tag expected
Start tag expected, '<' not found (line 1)What arrived is not XML — an HTML error page, a JSON body, or plain text served under an XML content type. The parser found no opening tag. - XML declaration allowed only at the start of the document
XML declaration allowed only at the start of the document (line 2)Whitespace precedes the XML declaration. A single blank line, or one space, before it is enough to make the document not well-formed. - Document is empty
Document is empty (line 1)Nothing arrived at all. Almost always a transport problem — a 204, a dropped connection, or a fetch that succeeded against the wrong URL. - Unsupported encoding
Unsupported encoding: UTF-9 (line 1)The declaration names an encoding the parser cannot decode — a typo, a vendor-specific label, or a charset the build of libxml2 was not compiled with. - Sequence ']]>' not allowed in content
Sequence ']]>' not allowed in content (line 2)The three characters ]]> are reserved as the CDATA terminator and cannot appear literally in element content, even outside a CDATA section. - Invalid numeric character reference
xmlParseCharRef: invalid xmlChar value 0 (line 2)A numeric character reference points at a code point XML does not allow — usually � or another control character that escaping cannot make legal. - Blank needed here
Blank needed here (line 1)Two parts of the XML declaration ran together with no space between them. Terse enough to be baffling, and it always means the same thing. - Malformed declaration expecting version
Malformed declaration expecting version (line 1)The document opens with <?xml but no version attribute. Version is the one part of the declaration that is not optional, and it must come first. - Unsupported XML version
Unsupported version '2.5' (line 1)The declaration names an XML version that does not exist. There are only two — 1.0 and 1.1 — and in practice you want 1.0 unless you know otherwise. - CData section not finished
CData section not finished (line 3)A CDATA section was opened and never closed with ]]>, so the rest of the document — closing tags included — was read as literal text inside it. - Error parsing attribute name
error parsing attribute name (line 2)A start tag was never closed with >, so the parser kept reading and found the next element's markup where an attribute name should have been. - CharRef: invalid decimal value
CharRef: invalid decimal value (line 2)A numeric character reference was opened with &# and never closed with a semicolon, so the parser read past the digits into text that is not a number.
Where these land
The elements of a RSS 2.0 document, each with the rules it has to follow and a broken and a fixed example that were run.
- <rss>The root element of an RSS feed. It carries the version attribute and exactly one <channel>, and nothing else.
- <channel>The feed itself: three required children — title, link and description — and every item beneath them.
- <title>The name of the feed, or of an item. Required on the channel; on an item, required only if there is no description.
- <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.
- <description>The feed's summary, or an item's body. Required on the channel, and the element where HTML inside XML becomes a problem.
- <item>One entry in the feed. Every child is optional except that it must have a title or a description.
- <guid>An item's permanent identifier. Readers use it to tell a new item from one already shown — and a feed that changes it republishes everything.
- <pubDate>When an item was published, in RFC 822 — the date format that is not ISO 8601, and is the most common thing wrong in a feed.
- <enclosure>The media file attached to an item — the element podcasting is built on, and the one whose length attribute is routinely wrong.
- <atom:link>An Atom element borrowed into RSS so a feed can name its own URL — the conventional way to declare rel="self".
Back to RSS 2.0 — root element, namespaces, constraints and a worked example.
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.