0

I used xsd.exe to create a class from xml schema. It generated several partial classes say one of which is Apple. I have added few fields to Apple. Now I want to serialize the object back to XML, but only according to the original schema. I want to skip the fields that I have introduced.

Any directions?

Sam
  • 933
  • 5
  • 14
  • 26

1 Answers1

2

IIRC you just need to decorate the new fields with [XmlIgnore]

http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlignoreattribute.aspx

James Manning
  • 13,429
  • 2
  • 40
  • 64