XML technologies / XML Schema / XML Schema element reference / xs:attributeGroup (reference)

(Excerpt from “XML Schema” by Eric van der Vlist)

Reference to a global attribute-group declaration.

<xs:attributeGroup
    id = xs:ID
    ref = xs:QName
    {beliebige Attribute mit einem Nicht-Schema-Namensraum}
    >
    Content: (xs:annotation?)
</xs:attributeGroup>

May occur within: xs:attributeGroup (global definition), xs:complexType (local definition), xs:complexType (global definition), xs:extension (complex content), xs:extension (simple content), xs:restriction (complex content), xs:restriction (simple content)

Description

Every occurrence of xs:attribute, except at the top level, references an attribute group, effectively replacing the reference with the attributes or attribute-group references in that group.

Restrictions

None.

Example

<xs:element name="book">
    <xs:complexType>
        <xs:sequence>
            <xs:element ref="isbn"/>
            <xs:element ref="title"/>
            <xs:element ref="author" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="character" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attributeGroup ref="bookAttribute"/>
    </xs:complexType>
</xs:element>

Attributes

id
Element ID according to W3C XML Schema.

ref
Qualified name of the referenced attribute group.

   

 

 

 

back to top