XML technologies / XML Schema / XML Schema element reference / xs:group (reference)
(Excerpt from “XML Schema” by Eric van der Vlist)
Reference to a global element-group declaration or local definition; local definitions cannot be referenced.
<xs:group
id = xs:ID
maxOccurs = ( xs:nonNegativeInteger | "unbounded" ) : "1"
minOccurs = xs:nonNegativeInteger : "1"
ref = xs:QName
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?)
</xs:group>May occur within: xs:choice (outside a group), xs:choice (within a group), xs:complexType (local definition), xs:complexType (global definition), xs:extension (complex content), xs:restriction (complex content), xs:sequence (within a group), xs:sequence (outside a group)
Description
In a local context, xs:group references an element group, logically replacing the reference with the group’s content.
While a group is being redefined through xs:redefine, a self-reference to that group means to include its original content at that point.
Restrictions
Groups cannot be recursive: a group cannot reference itself directly or indirectly within its own definition.
Example
<xs:element name="author">
<xs:complexType>
<xs:sequence>
<xs:group ref="name"/>
<xs:element ref="born"/>
<xs:element ref="dead" minOccurs="0"/>
</xs:sequence>
<xs:attribute ref="id"/>
</xs:complexType>
</xs:element>Attributes
id
Element ID according to W3C XML Schema.
maxOccurs
Maximum group occurrence count.
minOccurs
Minimum group occurrence count.
ref
Qualified name of the group to include.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de