XhtmlSyndicationContent

XhtmlSyndicationContent type exposes a feed item intended to be displayed to an end user and overrides default writing to stream behaviour. It converts html non-breaking space to it's ascii representation.

using System.ServiceModel.Syndication;
...
public class XhtmlSyndicationContent : TextSyndicationContent
{
    public XhtmlSyndicationContent(string text)
        : base(text, TextSyndicationContentKind.XHtml)
    {
    }

    protected override void WriteContentsTo(System.Xml.XmlWriter writer)
    {
        writer.WriteRaw(this.Text.Replace(" ", " "));
    }
}

Last edited Jan 25, 2013 at 11:44 AM by piotrdela, version 5

Comments

No comments yet.