8.2. Concepts and Observations

Element types have very sophisticated, and often very confusing, capabilities. The next four sections attempt to expose some of the confusing issues surrounding element types. These sections cover global and local element types, substitution groups, blocking, nil elements (those with no value), and the use of namespaces vis-à-vis element types.

8.2.1. Global and Local Element Types

An element type is global or local. A global element type is a child of the schema element in the XML schema document. Otherwise, the element type is local to a complex type.

Listing 8.1 portrays the city element type introduced in Section 8.1 as local to the complex type addressType.

Listing 8.1. A Local Element Type (address.xsd

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.