11.3. An Example of a Complex Type Specifying Nested Element Types
A complex type can specify multiple element types. An XML instance might contain an element whose element type’s structure type is this complex type; the XML instance contains nested elements. Listing 11.3 demonstrates how to create an XML representation of a complex type that contains nested element types. The thematic catalog example has a partOptionType complex type. This partOptionType permits a catalog entry to have a nested color, size, or both.
Listing 11.3. A Complex Type Specifying Nested Element Types (catalog.xsd)
<xsd:complexType name="partOptionType" block="#all" final="#all" id="partOptionType.catalog.cType"> <xsd:annotation> <xsd:documentation xml:lang="en"> Appropriate ... |
Get XML Schema Complete Reference, The 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.