Is it possible to use XSD.exe to auto generate a class which has a different datatype for an attribute than the one that is specified in the XSD by providing a annotation attribute before the element on the XSD.
The idea is, to keep the XSD just the way it is, but would like the auto generated class to have a different datatype for a specific attribute.
<xsd:simpleType name="idRestriction">
<Specify_Custom_Type="xsd:string" //This is what I'm looking for
<xsd:restriction base="xsd:decimal">
<xsd:attribute name="idAttribute" type="idRestriction" use="required" />
Generated class
[System.Xml.Serialization.XmlAttributeAttribute()]
public decimal id { // Would like the decimal to be string
get {
return this.idField;
}
set {
this.idField = value;
}
}
What I would like it to generate
[System.Xml.Serialization.XmlAttributeAttribute()]
public string id { // Notice decimal --> string
get {
return this.idField;
}
set {
this.idField = value;
}
}