XML Şeması öznitelik Grubu Öğesi
❮ Eksiksiz XML Şeması Referansı
Tanım ve Kullanım
AttributeGroup öğesi, bir grup olarak karmaşık tür tanımlarına dahil edilebilmeleri için bir dizi öznitelik bildirimini gruplamak için kullanılır.
Eleman Bilgileri
- Ana öğeler: nitelikGroup, ComplexType, schema, kısıtlama (hem simpleContent hem de ComplexContent), uzantı (hem simpleContent hem de ComplexContent)
Sözdizimi
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(? işareti, öğenin sıfır veya bir kez bulunabileceğini bildirir ve * işareti, öğenin niteGroup öğesi içinde sıfır veya daha fazla kez bulunabileceğini bildirir)
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 |
örnek 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>
Yukarıdaki örnek, "person" adlı karmaşık bir türde kullanılan "personattr" adlı bir öznitelik grubunu tanımlar.
❮ Eksiksiz XML Şeması Referansı