We will start by looking at complex types containing simple content
because they are closest to simple types, which
we've seen recently, and they also provide an easier
transition to the more complex world of complex contents. We will not
discuss the creation and derivation of simple types, already covered
in Chapter 5, "Creating Simple Datatypes", but instead will focus on complex
types' simple content models (i.e., elements having
only text nodes and attributes) and study how they are created and
derived.
The only things that need to change here are that the definition of
the simple type cannot be directly embedded in the xs:extension(complex content) and that it needs to be referenced through its
base
attribute.
The syntax used to restrict the text child is the same as the syntax
used to derive simple types by restriction. The facets are the same
as well. These facets must be followed by the new list of attributes,
which may have different types as long as they are derived from the
types of the attributes from the base type. Attributes that are not
mandatory in the base type can be specified in the new list as
"prohibited," and attributes that
are not included are considered unchanged. Following are some
examples of derivations that start from a simple content datatype
equivalent to the content model just shown: