Generation of generic lists does not work with some schemas


Occurrence of the bug:
  1. generate a cs file from IODD1.0.1.xsd
  2. generate a cs file from IODD1.1.xsd
    Compare the type "UIntegerT" from 1.0.1 (OK) and 1.1 (Not OK).
    The Problem:
  3. The ArgumentNullException will be thrown when using a xml file wihtout an item. (this is legal)
  4. The access via List<> is not possible.

file attachments


alexmeyergleaves wrote Jan 4, 2011 at 11:49 AM

I assume the problem is with the Items property. Can you please try to manually add a ShouldSerialize method for the list property in question and then test without an item?

public bool ShouldSerializeItems()
return (itemsField != null) && (itemsField.Count > 0);

If that solves the problem we can look at making a code change to add this to the generated code.

wrote Jan 10, 2011 at 8:02 AM

SynchroM wrote Jan 10, 2011 at 8:02 AM

If I modify the generated code, I can enable the serialization without an item. But the main problem is the miss of the list!
I expect the code like UIntegerT101.cs
but the generator creates code like UIntegerT11.cs

wrote Jan 10, 2011 at 8:03 AM

SynchroM wrote Jan 10, 2011 at 8:03 AM

Notice the difference in line 31.
Thank you for your support!

wrote Feb 13, 2013 at 3:15 AM