Deriving Complex Types

Simple datatypes do offer a lot of power within an XML Schema, in terms of managing your data. However, they do lack the flexibility to define new complex representations of data within the content model of an element.

For defining complex types, XML Schemas provide the <complexType> mechanism, which allows you to define your own complex types for element content models.

Complex types can also be defined independently of element declarations, so that they can be applied to multiple elements, or so that you may derive new complex types, based on previous types that you have defined in a schema. There are two mechanisms that you can use for deriving new complex types: restriction and extension.

Complex Types by Restriction ...

Get Special Edition Using XML, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.