George George

George George

  • NA
  • 778
  • 0

XML attribute issue during deserialize

Jan 6 2009 3:56 AM

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


Answers (2)