11.1. An Example of a Complex Type Specifying Empty Content
A complex type can specify empty content. In other words, an XML instance that contains an element that is an instance of an element type whose structure type is this complex type does not contain any text or any other elements. The freePriceType complex type presented in Listing 11.1 is used to “price” items in the catalog that have no cost associated with them. Any discount catalog item has an authorization attribute. The complex type freePriceType has no content (that is, no base simple type or nested element types):
Listing 11.1. A Complex Type Specifying Empty Content (pricing.xsd)
<xsd:complexType name="freePriceType" block="#all" final="#all" id="freePriceType.pricing.cType"> ... |
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.