XML technologies / XML Schema / XML Schema element reference / xs:extension (simple content)
(Excerpt from “XML Schema” by Eric van der Vlist)
Extending a simple content model.
<xs:extension
base = xs:QName
id = xs:ID
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?, ((xs:attribute | xs:attributeGroup)*, xs:anyAttribute?))
</xs:extension>May occur within: xs:simpleContent
Description
This element extends a simple type or a complex type with simple content into a complex type with simple content: an element content model with a text node and some attributes. Attribute base specifies the base type; the attributes to add are listed through xs:attributes, xs:attributeGroup and xs:anyAttribute embedded within element xs:extension.
Deriving a simple type by extension this way is the only way to create a complex type with simple content.
Restrictions
The base type’s definition cannot be embedded in element xs:extension, and the base type must be global.
W3C XML Schema uses the same element name (xs:extension) for extending complex types with simple or complex content, but the elements have different content models.
Example
<xs:element name="title">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="string255">
<xs:attribute ref="lang"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>Attributes
base
Qualified name of the base type, simple or complex with simple content.
id
Element ID according to W3C XML Schema.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de