Skip to Main Content
XML Schema
book

XML Schema

by Eric van der Vlist
June 2002
Intermediate to advanced content levelIntermediate to advanced
396 pages
11h 8m
English
O'Reilly Media, Inc.
Content preview from XML Schema

Name

xs:extension(complex content) — Extension of a complex content model.

Synopsis

<xs:extension
           base          = xs:QName
           id            = xs:ID
           {any attributes with non-schema namespace}
           >
           Content: ((xs:annotation?), (, (xs:group | xs:all | xs:choice |
                      xs:sequence)?, ((xs:attribute | xs:attributeGroup)*,
                      xs:anyAttribute?)))
</xs:extension>

May be included in: xs:complexContent

Description

Extension of a complex (or mixed) content complex type. This derivation method can be applied to another complex content complex base type, and allows the addition of elements and attributes to this base type. The additional elements are added after the compositor used in the base type.

When new elements are added during a derivation by extension, the resulting content model is equivalent to creating a sequence that contains the compositor used to define the base type and the one included in the xs:extension element.

Restrictions

Complex types that use a xs:all compositor cannot be used as base types for derivations by extension, except when those extensions add only attributes.

New elements added to base types using a xs:choice compositor are added in sequence after the xs:choice, rather than as new choices.

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

W3C XML Schema’s element ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means
Beginning XML, 5th Edition

Beginning XML, 5th Edition

Danny Ayers, Liam R.E. Quin, Joe Fawcett
XML Schema Complete Reference, The

XML Schema Complete Reference, The

Cliff Binstock, Chris Galtenberg, Mike Wooding, Chris Dix, Mitchell Smith, Dave Peterson
Programming Web Services with SOAP

Programming Web Services with SOAP

James Snell, Doug Tidwell, Pavel Kulchenko

Publisher Resources

ISBN: 0596002521Supplemental ContentErrata Page