XML-skema - kenmerkGroepelement
❮ Voltooi XML-skemaverwysing
Definisie en gebruik
Die attributeGroup-element word gebruik om 'n stel eienskapverklarings te groepeer sodat hulle as 'n groep in komplekse tipe definisies geïnkorporeer kan word.
Elementinligting
- Ouer-elemente: kenmerkGroep, kompleksType, skema, beperking (beide eenvoudigeInhoud en komplekseInhoud), uitbreiding (beide eenvoudigInhoud en kompleksInhoud)
Sintaksis
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(Die ? teken verklaar dat die element nul of een keer kan voorkom, en die * teken verklaar dat die element nul of meer keer binne die kenmerkGroup element kan voorkom)
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>
Die voorbeeld hierbo definieer 'n kenmerkgroep genaamd "personattr" wat gebruik word in 'n komplekse tipe genaamd "persoon".
❮ Voltooi XML-skemaverwysing