In version 1.0 of .NET, DataSets do not provide an internal MappingType that allows element data to be wrapped with a CDATA section when XML is generated. This can present a problem when data pulled from the database contains reserved XML characters such as < since the DataSet GetXml() and WriteXml() methods escape these characters (< becomes <). This demo shows how DataSet elements can be mapped to CDATA sections using a custom class named CDATAGenerator. Doing so helps to preserve data "as is" rather than converting some of it into entities.
|