XML Schema attribuutGroup Element
❮ Volledige XML-schemareferentie
Definitie en gebruik
Het element attributeGroup wordt gebruikt om een set attribuutdeclaraties te groeperen, zodat ze als een groep kunnen worden opgenomen in complexe typedefinities.
Elementinformatie
- Bovenliggende elementen: attributeGroup, complexType, schema, restrictie (zowel simpleContent als complexContent), extension (zowel simpleContent als complexContent)
Syntaxis
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(Het ?-teken geeft aan dat het element nul of één keer kan voorkomen, en het *-teken geeft aan dat het element nul of meer keer kan voorkomen in het element attributeGroup)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Optional. Specifies the name of the attribute group. Name and ref attributes cannot both be present |
ref | Optional. Specifies a reference to a named attribute group. Name and ref attributes cannot both be present |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
voorbeeld 1
<xs:attributeGroup name="personattr">
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
Het bovenstaande voorbeeld definieert een attribuutgroep met de naam "personattr" die wordt gebruikt in een complex type met de naam "person".
❮ Volledige XML-schemareferentie