so far everything went smoothly but when I tried this xsd errors came out. I have simple example:
<simpleType name="waluta_type">
<restriction base="token">
<enumeration value="PLN"/>
<enumeration value="EUR"/>
<enumeration value="GBP"/>
<enumeration value="USD"/>
</restriction>
<complexType name="cena_type">
<simpleContent>
<extension base="double">
<attribute name="waluta" type="moja:waluta_type" use="required"/>
</extension>
</simpleContent>
</complexType>
xsd2code does not generate property for waluta:
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://example/MS/")]
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://example/MS/", IsNullable = true)]
public partial class cena_type : EntityBase<cena_type>
{
[EditorBrowsable(EditorBrowsableState.Never)]
private double valueField;
[System.Xml.Serialization.XmlTextAttribute()]
public double Value { get; set; }
[System.Xml.Serialization.XmlAttributeAttribute()]
public waluta_type waluta
{
get
{
return this.walutaField;
}
set
{
this.walutaField = value;
}
}
}
and I receive and error that [...] does not contain a definition for 'walutaField' and no extension method 'walutaField' accepting a first argument of type 'ConsoleApplication1.cena_type' could be found (are you missing a using directive or an assembly reference?). Has anyone run into the same problem and could give me a hint?
Doing some changes in order to generate the class adding the definition to an existent xsd I've gotthis code:
I've used this definition:
So, wich is the version tha xsd2code ? I'm using the newer.