SimpleType Element Binding Support
The .NET Framework provides partial binding support for the <simpleType> element.
The only simple types that bind to code without loss are lists applied to XML attributes and enumerations restricting string-based types.
The .NET Framework provides fully expressive bindings for simple types defined as lists only when the types are used for XML attributes, as opposed to XML elements. See theelement.
For simple types defined through restriction, bindings are produced only for the enumeration of string-based simple types. See theelement.
The Xsd.exe tool ignores simple types defined through union, via theelement.
|Possible Attributes||Binding Support|
The final attribute can be applied to a data type to prevent it from being derived.
Xsd.exe ignores the final attribute, as well as the finalDefault attribute of the <schema> element.
The Xsd.exe utility ignores the id attribute, which is intended to provide a unique identifier. Instead, Xsd.exe recognizes the name attribute.
The value of the name attribute becomes the name of the .NET Framework type that Xsd.exe generates from the simple type.
No attempt is made to change case to adhere to coding conventions. For example, if the name attribute of a <simpleType> element has the value testInfo, the ensuing class gets named testInfo, rather than the capitalized TestInfo. If a name conflicts with a reserved keyword, the resulting name is prepended with the symbol @.
When Xsd.exe generates a <simpleType> definition from a class, it uses the class name for the value of the name attribute. An alternate name—name attribute value—can be supplied via theproperty.