Поделиться через


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.

Explanation

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 the List Element Binding Support element.

For simple types defined through restriction, bindings are produced only for the enumeration of string-based simple types. See the Restriction Element Binding Support element.

The Xsd.exe tool ignores simple types defined through union, via the Union Element Binding Support element.

Possible Attributes Binding Support

final

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.

id

The Xsd.exe utility ignores the id attribute, which is intended to provide a unique identifier. Instead, Xsd.exe recognizes the name attribute.

name

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 the TypeName property.

See the Name Attribute Binding Support attribute.

Possible parent elements: <attribute>, <element>, <list>, <redefine>, <restriction>, <schema>, <union>

Possible child elements: <annotation>, <list>, <restriction>, <union>

See Also

Reference

XmlSchemaSimpleType