Contains extensions on simpleContent. This extends a simple type or a complex type that has simple content by adding specified attribute(s), attribute group(s), or anyAttribute.
<extension base = QName id = ID {any attributes with non-schema Namespace}…> Content: (annotation?, ((attribute | attributeGroup)*, anyAttribute?)) </extension>
The base value must be a qualified name (QName).
Required.
Optional.
Number of occurrences | One time |
Parent elements | simpleContent, |
Contents | annotation, attribute, attributeGroup, anyAttribute |
The following example extends a defined simpleType by adding an enumerated attribute.
<xs:simpleType name="mountainBikeSize"> <xs:restriction base="xs:string"> <xs:enumeration value="small" /> <xs:enumeration value="medium" /> <xs:enumeration value="large" /> </xs:restriction> </xs:simpleType> <xs:complexType name="FamilyMountainBikes"> <xs:simpleContent> <xs:extension base="mountainBikeSize"> <xs:attribute name="familyMember"> <xs:restriction base="xs:string"> <xs:enumeration value="child" /> <xs:enumeration value="male" /> <xs:enumeration value="female" /> </xs:restriction> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType>
XML Schema Reference (XSD) | XML Schema Elements
For more information, see the W3C XML Schema Part 1: Structures Recommendation at http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-simpleContent::extension.