XML technologies / XML Schema / XML Schema element reference / xs:extension (complex content)
(Excerpt from “XML Schema” by Eric van der Vlist)
Extending a complex content model.
<xs:extension
base = xs:QName
id = xs:ID
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: ((xs:annotation?), (, (xs:group | xs:all | xs:choice | xs:sequence)?, ((xs:attribute | xs:attributeGroup)*, xs:anyAttribute?)))
</xs:extension>May occur within: xs:complexContent
Description
Extending a complex type with complex or mixed content. This derivation applies to another complex base type with complex content and permits adding elements and attributes. Additional elements follow the compositor used in the base type.
Adding elements during extension yields a content model equivalent to a sequence of the base type’s compositor and the compositor in element xs:extension.
Restrictions
Complex types using an xs:all compositor cannot be bases for extension unless only attributes are added.
New elements added to base types using an xs:choice compositor are appended sequentially after xs:choice, rather than as new alternatives.
Example
<xs:element name="character">
<xs:complexType>
<xs:complexContent>
<xs:extension base="basePerson">
<xs:sequence>
<xs:element ref="qualification"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>Attributes
base
Qualified name of the base type.
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