XML attribute issue during deserialize RRS feed

  • Question

  • 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,

    Tuesday, January 6, 2009 8:58 AM