XML Schema group Element
Complete XML Schema Reference Manual
Definition and Usage
The group element is used to define a group of elements for use in complex type definitions.
Element Information
- Parent elements: schema, choice, sequence, complexType, restriction (both simpleContent and complexContent), extension (both simpleContent and complexContent)
Syntax
id=ID name=NCName ref=QName maxOccurs=nonNegativeInteger|unbounded minOccurs=nonNegativeInteger any attributes (annotation?,(all|choice|sequence)?) (The ? symbol declares that within the group element, the element can appear zero or one time.) Optional. Specifies the name of the group. The name must be a no-colon name (NCName) as defined in the XML Namespaces specification. This attribute is used only when the schema element is the parent of the group element. In that case, the group is a model group used by complexType, choice, and sequence elements. The name attribute and ref attribute cannot both be present. Optional. References the name of another group. The ref value must be a QName. ref can contain a namespace prefix. The name attribute and ref attribute cannot both be present. Optional. Specifies the maximum number of times the group element can appear in the parent element. The value can be an integer greater than or equal to zero. If you do not want to set any limit on the maximum, use the string "unbounded". The default is 1. Optional. Specifies the minimum number of times the group element can appear in the parent element. The value can be an integer greater than or equal to zero. The default is 1. Optional. Specifies any other attributes with a non-schema namespace. The following example defines a group containing a sequence of four elements, and uses this group element in a complex type definition:
property
Description
id
Optional. Specifies a unique ID for the element.
name
ref
maxOccurs
minOccurs
any attributes
Example 1
Complete XML Schema Reference Manual