Thursday, March 13, 2008

Just discovered wcsf...

Relative to xsd.exe, WCSF is vastly superior.

It generates reasonable names

It uses generics.

It has a user interface.

One problem...

constructs using choice like this



< xs:element name="Amount">
< xs:complexType>
< xs:choice>
< xs:element ref="MassAmount"/>
< xs:element ref="VolumeAmount"/>
</xs:choice>
</xs:complexType>
</xs:element>


generate crappy C# code like this:



[System.Xml.Serialization.XmlElementAttribute("MassAmount", typeof(MassAmount))]
[System.Xml.Serialization.XmlElementAttribute("VolumeAmount", typeof(VolumeAmount))]
public object Item
{
get
{
return this.item;
}
set
{
if ((this.item != value))
{
this.item = value;
}
}
}

Why couldn't that just allow setting one or the other enum?

No comments: