G
Guest
I am serializing a class to XML using the code below, but the XmlSerializer
opens the object's tag with some very verbose attributes: "<TestClass
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml
ns:xsd="http://www.w3.org/2001/XMLSchema">"
I am serializing thousands of these objects, so for performance I would like
to exclude the "xmlns:" attributes. Is there an easy way to do that with the
standard XmlSerializer, or any other .NET serializers?
XmlTextWriter writer = new XmlTextWriter(Console.Out);
XmlSerializer serializer = new XmlSerializer(typeof(TestClass));
TestClass test = new TestClass();
serializer.Serialize(writer, test);
writer.Close();
opens the object's tag with some very verbose attributes: "<TestClass
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xml
ns:xsd="http://www.w3.org/2001/XMLSchema">"
I am serializing thousands of these objects, so for performance I would like
to exclude the "xmlns:" attributes. Is there an easy way to do that with the
standard XmlSerializer, or any other .NET serializers?
XmlTextWriter writer = new XmlTextWriter(Console.Out);
XmlSerializer serializer = new XmlSerializer(typeof(TestClass));
TestClass test = new TestClass();
serializer.Serialize(writer, test);
writer.Close();