11.2. An Example of a Complex Type That Adds Attributes to a Simple Type

A complex type can add attribute types to a simple type. Listing 11.2 is the complex type salePriceType. salePriceType extends the globally described dollarPriceType simple type by adding the saleAttributeGroup attribute group. Note that the simpleContent element provides the functionality to extend simple types into complex types.

Listing 11.2. Adding an Attribute to a Simple Type (pricing.xsd)
 <xsd:complexType name="salePriceType" block="#all" final="extension" id="salePriceType.pricing.cType"> <xsd:annotation> <xsd:documentation xml:lang="en"> Anything on sale must have a price and an authorization. </xsd:documentation> </xsd:annotation> <xsd:simpleContent> <xsd:extension ...

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.