RSS feeds do not validate
I have created a test RSS feed of the news content and it falis to validate at W3C Feed Validation
This feed does not validate.
In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
<?xml version="1.0" encoding="utf-8"?><rss xmlns:a10="http://www.w3.org/200 ...
... scription /><a10:contributor><a10:name> </a10:name><a10:email>sfarm@sd ...
^
line 1, column 410: (2 occurrences) [help]
... ws-item-2</link><author>sfarmer@sdms.org</author><title>SDMS News Item # ...
^
... -44de-88b9-bfd2286cf54f" /></p></description><pubDate>Wed, 11 M ...
^
... 11 May 2011 18:43:25 Z</pubDate></item></channel></rss>
^
Hi Scott Farmer,
If you want manually to change the output you have to inherit SyndicationPipe and override FormatOutputData. The method have to return SyndicationFeedFormatter. We are using Atom10FeedFormatter or Rss20FeedFormatter which comes with .NET framework. After that you have to execute this code :
PipeFactory.UnregisterPipe("RSS" );
PipeFactory.RegisterPipeType("RSS", typeof(YourSyndicationPipeType));
UPDATE:
As the PipeFactory
class is marked as obsolete (will be removed in Sitefinity 5.1) and it is replaced by the Telerik.Sitefinity.Publishing.PublishingSystemFactory
class, the following code could be used instead:
using
System;
using
System.ServiceModel.Syndication;
using
Telerik.Sitefinity.Abstractions;
using
Telerik.Sitefinity.Publishing;
using
Telerik.Sitefinity.Publishing.Pipes;
namespace
SitefinityWebApp
public
class
Global : System.Web.HttpApplication
protected
void
Application_Start(
object
sender, EventArgs e)
Bootstrapper.Initialized += Bootstrapper_Initialized;
void
Bootstrapper_Initialized(
object
sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
if
(e.CommandName ==
"Bootstrapped"
)
PublishingSystemFactory.UnregisterPipe(RSSOutboundPipe.PipeName);
PublishingSystemFactory.RegisterPipe(RSSOutboundPipe.PipeName,
typeof
(CustomFormatRssOutboundPipe));
public
class
CustomFormatRssOutboundPipe : RSSOutboundPipe
protected
override
SyndicationFeedFormatter CreateFeedFormatter(SyndicationFeed feed)
var formatter =
base
.CreateFeedFormatter(feed);
var rssFormatter = formatter
as
Rss20FeedFormatter;
if
(rssFormatter !=
null
)
rssFormatter.SerializeExtensionsAsAtom =
false
;
return
formatter;