tags:

views:

43

answers:

0

I'm trying to add CDATA to a SyndicationPerson object in C#.

SyndicationPerson author = new SyndicationPerson();
author.Name = string.Format("<!CDATA[{0}]]>", name);
author.Email = string.Format("<!CDATA[{0}]]>", email);
this.Authors.Add(author);

However, this serializes incorrectly because SyndicationPerson doesn't write to Xml as type "xhtml". Therefore, the output is:

<atom:author>
      <atom:name>&lt;![CDATA[Bob Jones]]&gt;</atom:name>
      <atom:email>&lt;![CDATA[[email protected]]]&gt;</atom:email>
</atom:author>

Is there a way around this? I've even tried

TextSyndicationContent authorName = TextSyndicationContent.CreateXhtmlContent(name);

to no avail. Thanks!