I've recently setup my own blog and am writing an RSS feed for the blog. I intend to make a script to do it for me once I get the rules right, but for now, I am facing errors in validating the XML.
There RSS feed is here
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/res/preview.xsl"?>
<rss version="2.0">
<channel>
<title>Tuesday's Gone-bholagabbar</title>
<link>http://shreyans-sheth.me/blog/gsoc/home.html</link>
<description><![CDATA[This is bholgabbar's blog, 'Tuesday's Gone'. I (intend to) write about Programming, Algorithms and just about anything under the sun]]></description>
<lastBuildDate>Tue, 26 Apr 2016 20:44:55 GMT</lastBuildDate>
<item>
<title>Hello World!</title>
<link>http://shreyans-sheth.me/blog/home.html</link>
<pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
<description><![CDATA[GSoC '16 #awwwyea']]></description>
<content:encoded><![CDATA[
<p>And finally it's all paid off. Endless IRC conversations, reading code and tutorials I would barely understand at first and all those sleepless nights coding, waiting for mentor replies and the results.</p>
<p>Selected for Google Summer of Code '16 with OpenMRS</p>
]]>
</content:encoded>
</item>
</channel>
</rss>
When I try to validate the XML feed here: http://www.feedvalidator.org/check.cgi?url=http%3A%2F%2Fshreyans-sheth.me%2Fblog%2Ftuesdays-gone.xml
you can check the errors I get. I have been specifically asked to include a content tag in the field and idk but the data in the content feed is not being validated and showing up in the feed. There seems to be an issue with the date as well. What could be the problem?
Your need to declare namespace for content:
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
...
</channel>
</rss>
This date <pubDate>Fri, 26 April 2016 14:34:13 +0000</pubDate>
should be in form <pubDate>Tue, 26 Apr 2016 14:34:13 +0000</pubDate>
. ('April' => 'Apr' and 'Fri' => 'Tue' to be valid)
After those changes, your example feed was valid. The validator also suggested adding guid
elements and adding namespace for atom:link