I have a XSD I generated using xsd.exe and then created a class off the the xsd. Everything worked great but some of the elements have common business rules. For example all of the amounts in our xml are expressed without the decimal so 3.94$ becomes 394. I have created a xml simple type to represent all of the attributes that are defined in this way, but haven’t figured out how to map the xsd type to a .net class that can handle the business logic of how the data has to be stored in the xml. I have created complex types before but not simple types that are used in attributes can some one point me in the right directory
A very Simplified XML snip it
<Check amt="356" >
<LNItem amt="123" />
<LNItem amt="223" />
</Check>
I would like a class like the following.
[XmlType(Check)]
public
{
AmtType Amt {get;set}
}
You’d have to do something like this:
Note that dividing a
decimalby a scale factor less than zero is significant: it removes the decimal places from thedecimalrepresentation, while multiplying by its reciprocal will not. In other words: