Duplicate RSS 2.0 date elements


Here’s some RSS minutea for your Monday. For the longest time I’ve been exporting feeds with Dublin Core dc:date elements on each item:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" 
<description>An example RSS feed</description>
<pubDate>Sat, 19 Jun 2021 19:07:53 +1000</pubDate>	
<title>Hello, world</title>
<pubDate>Sat, 19 Jun 2021 19:07:53 +1000</pubDate>

Validators recommend against duplicating semantics:

Your channel contains two elements which mean the same thing. This can occur in RSS 2.0 when you mix core elements and namespace elements. This can confuse news aggregators and RSS parsers, since there are no universally accepted rules about which element takes precedence.

Solution: Remove one of the redundant elements.

I assert they’re don’t mean the same thing, and are therefore not redundant!

The RSS 2.0 spec says this about pubDate:

Its value is a date, indicating when the item was published. If it’s a date in the future, aggregators may choose to not display the item until that date.

This isn’t analogous to Dublin Core’s date:

A point or period of time associated with an event in the lifecycle of the resource.

In other words, pubDate is narrowly defined as publication date, whereas dc:date is broader in semantic scope. They may be used for the same thing, but one could imagine dc:date referring to an event the item describes, whereas pubDate is when that description was published. Think of an anime convention that has a cosplay content next Thursday, being announced in a post today.

(The same thing applies to Atom’s updated element, and Dublin Core’s dateSubmitted).

But what if they do mean the same thing? Calling them redundant ignores the question of precision. RSS 2.0’s pubDate (unfortunately) permits 2-digit years, as per RFC-822. dc:date mandates 4-digit years as per ISO 8601. pubDate is expressed with 4-digit years by convention, but it’s conceivable and entirely valid for dc:date to provide additional information than what pubDate has.

Which leads us to the justification for removing dc:date, so as not to “confuse news aggregators”. As someone who maintains and builds aggregators, I don’t buy this. I wouldn’t think anything introduced with namespaces would take precedence over a mandatory element like pubDate.

Does any of this matter? I mean, does anything, right!?

Author bio and support


Ruben Schade is a technical writer and IaaS engineer in Sydney, Australia who refers to himself in the third person in bios. Wait, not BIOS… my brain should be EFI by now.

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or buy some silly merch. Thanks!