You can reuse element definitions using the name attribute in simpleType elements. The name attribute enables you to specify a name that refers to the simpleType element definitions. For example, the following code snippet uses the name attribute to name the simpleType element definition as typename:
<xs:simpleType name="typename">
<xs:restriction base="xs:string">
<xs:length value="8"/>
</xs:simpleType>
To reuse the above definition, you need to specify typename as a value for the type attribute in simple type element declarations. For example, in the following declaration, the EmpNumber element reuses the preceding simpleType element definition using typename as a value for the type attribute:
<xs:element name="EmpNumber" type="typename" />
|