Model Group Properties in XML Schemas

After you create a group node or a complexType node, you can add a model group node as a child. A model group specifies rules for the occurrence of elements. These are the elements that are the children of the group or complexType in an instance document. A model group references and defines elements. Model groups have the properties described in Table 46:

Property
Description
Type
The type is always Model Group.
Modifier
Specifies the occurrence rules for the elements that you add as children of the model group node. Specify one of the following values:
l all specifies that each element must appear exactly zero or one time. The elements can appear in any order. In an instance document, the children of the group or complexType can include 0 or 1 instance of each element.
l choice specifies that exactly one element can be present, and there must be only one instance of that element. In an instance document, exactly one element can be a child of the group or complexType.
l sequence specifies that the elements must appear in the order in which they are specified in the schema. For each element, you can specify whether it is optional and whether it can appear more than once. The default is that exactly one must be present in an instance document. In an instance document, each element that appears must be in the same order as in the schema.
Another value you can specify is any. When you specify any, you do not add any element definitions or references to elements. As the name implies, any element can appear any number of times.
Min Occur.
Specifies the minimum number of instances of this model group that can appear in this group or complexType. If a model group is not required to be present, specify 0.
Max Occur.
Specifies the maximum number of instances of this model group that can appear in this group or complexType. If there is no limit to the number of instances, specify unbounded.
Table 46. Model Group Properties

 
Free Stylus Studio XML Training: