Hi
The company I work for use a state implementation based on the XmlSerializer generic class in so far that we have state classes with simple public variables and no logic which we then use the XMLSerializer to serialize in in great extend nest.
For instance class A has a Class B and a class C variable, each with a state class being serialized and put into a state class of the owner class.
Is there any way outside actually implementing IXmlSerializable that I can allow to include XML directly in own output xml instead of escaping it when it meets brackets in strings for instance?
The deal is that since all state classes individually are serialized simple classes, I know that they contain valid XML and that that will conform to the XMLDOM even if piecing them together and manually implementing the serializers will be quite time
consuming even if limiting to the CSharp framework, but the multi layer escaped structure is awfull to the eye.
See this simplified example:
using System.Xml;
using System.Xml.Serialization;
using System;
using System.IO;
namespace TingTester {
class Program {
static void Main(string[] args) {
var simpleser = new XmlSerializer(typeof(LittleStateClass));
string serialized = Serialize(GetSimpleVersion(), simpleser);
Console.WriteLine("Simple elements contain no escapes: {0}", !serialized.Contains("&"
View Complete Post