Is it possible via an attribute of some sort to serialize a string as CDATA using the .Net XmlSerializer?
Tell me more
×
Stack Overflow is a question and answer site for
professional and enthusiast programmers. It's 100% free, no registration required.
|
|||||||||||||||||||
|
In addition to the way posted by John Saunders, you can use an XmlCDataSection as the type directly, although it boils down to nearly the same thing:
|
|||||||
|
Usage:
Output:
|
|||||
|
CDataContent
if you're only reading XML.XmlSerializer.Deserialize
will automatically turn it into text for you. – Chris S Nov 26 '11 at 12:31