Chapter 15 Reusable groups

XML Schema provides the ability to define groups of element and attribute declarations that are reusable by many complex types. Named model groups are fragments of content models, and attribute groups are bundles of attributes that are commonly used together. This chapter explains how to define and reference named model groups and attribute groups.

15.1 Why reusable groups?

Defining a group and reusing it many times has the advantages of:

• encouraging consistency across schema components,

• allowing the schema author to change the content model in only one place,

• making it obvious that certain complex types share similar children,

• in many cases, making the schema less verbose.

Get Definitive XML Schema now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.