Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML Schema group Element

XML Schema group Element


XML Schema Reference Manual 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

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.)

property Description
id Optional. Specifies a unique ID for the element.
name

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.

ref

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.

maxOccurs

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.

minOccurs

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.

any attributes

Optional. Specifies any other attributes with a non-schema namespace.

Example 1

The following example defines a group containing a sequence of four elements, and uses this group element in a complex type definition:

  xs:sequence

    

    

    

    

  

  

  


XML Schema Reference Manual Complete XML Schema Reference Manual