Hello everyone,
I am using xsd to generate a C# class from an XML file. I noticed there are a couple of fields of the generated classes are marked with various XML attribute, like XML attribute and XML element.
Now I want to add more restrictions to the input XML file during deserialization,
- Make some fields in the C# class not nullable during serialization;
- Make some fields to accept only numbers (currently the automatic generated C# file is using string type other than number type to represent the fields).
Any ideas about how to decorate the generated C# class file to achieve the goal?
thanks in advance,
George
George GeorgePosted Jan 10, 2009, 8:35 AM
Thanks John! It is a good start-point for me. But I can not find any good samples for those methods for me to begin code. Could you provide some pseudo code or refer to some online samples to learn?
regards,
George
Guest UserPosted Jan 6, 2009, 10:28 AM