Purpose | This element enables you to define simple content by adding attributes for an element. |
Parent element | xs:complexContent ,
xs:simpleContent |
Child elements | xs:all , xs:anyAttribute ,
xs:attribute ,
xs:attributeGroup ,
xs:choice ,
xs:group ,
xs:sequence
|
Attributes | base |
Name | Type | Description |
---|---|---|
base |
xs:QName |
When you derive a new simple type from an existing
simple type (the base type) using the xs:extension element, you
must use the base attribute to specify the base
type to be used for the derivation. See the example below.
|
The following example shows the use of the xs:extension
element to extend an element of complex type with two attributes, namely
form
and brand
.
In this example a base type
xs:string
(defined by
XML
Schema) is used for derivation of a new type by extension.
<xs:extension base = "xs:string"> <xs:attribute name = "form" type = "xs:string" use = "required"></xs:attribute> <xs:attribute name = "brand" type = "xs:string"></xs:attribute> </xs:extension>