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 64:

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 64. Model Group Properties

XML Schema Tutorial

An XML Schema Tutorial that explores real-world XML Schema development issues, XML Schema examples and various use cases.

XML Whitepapers

Learn how XML can help you meet your business objectives by reading free XML Whitepapers covering XML, XML Schema, XQuery, SQL/XML, and FIXML technolgies employed in real world case studies.

DTD Parser

Learn about the powerful DTD parser technologies that are supported in Stylus Studio's DTD tools, including DOM and SAX based DTD parsing components.

FLWOR - An Introduction to the XQuery FLWOR Expression

An XQuery FLWOR Tutorial, covering an introduction to the main constructs of the XQuery FLWOR expression, including: For, Let, Where, Order By, and Return. Written by the W3C's Dr. Michael Kay.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member