XSD.exe and optional, simple-type attributes RRS feed

  • Question

  • Can XSD.exe tool generate classes from XSD definition file in a way that optional simple-type attributes are mapped onto nullable value types ?

    for example:
      int? fieldName
    instead of
      int [fieldName] and  bool [fieldName]Specified

    Thursday, June 4, 2009 10:39 PM


  • > onto nullable value types

    AFAIK, no.  XSD doesn't play well with nullable value types.  This has been a big disappointment to me, actually.  We can only hope that in the future Microsoft will invest further in XSD and other XML-schema technologies.  The latest WCF DataContractSerializer just doesn't fit with a lot of real world XML interop scenarios.

    • Marked as answer by Zhi-Xin Ye Wednesday, June 10, 2009 10:18 AM
    Thursday, June 4, 2009 10:47 PM