Serializing object properties as CDATA using XMLSerializer

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey,

Thanks in advanced.

Could someone tell me how to serialize an objects property as CDATA.

I currently have a properly as follows which creates the XML Element just
fine, however, I don't know how to specify that the long description should
be wrapped with CDATA. I have seen in multiple places on the web that this
is suppose to be included out of the box in .NET 2.0 and I see a work around
for .NET 1.1 at
http://geekswithblogs.net/cmartin/archive/2005/11/30/61705.aspx. Since I am
using .NET 2.0 I would like to use the out of box functionality if it does
exist.

[XmlElement("long")]
public string LongDescription
{
get { return _long; }
set { _long = value; }
}

Thanks,

Tom
 
Back
Top