elemento XML Schema attributeGroup
Definizione e utilizzo
attributeGroup elemento è utilizzato per dichiarare attributi sono combinati, in modo che queste dichiarazioni possono essere combinati per formare in tipo complesso.
Informazioni elemento
- elemento padre: attributeGroup, complexType, schema, restrizione (sia simpleContent e complexContent), estensione (sia simpleContent e complexContent)
grammatica
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(? Segno dichiara attributeGroup elemento, l'elemento può verificarsi zero o una volta, * segno dichiara che l'elemento può verificarsi zero o più volte.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
name | 可选。规定属性组的名称。name 和 ref 属性不能同时出现。 |
ref | 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
esempio 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>
<xs:attribute name="attr1" type="string"/>
<xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>
<xs:complexType name="person">
<xs:attributeGroup ref="personattr"/>
</xs:complexType>
L'esempio precedente definisce un gruppo di proprietà denominato "personattr" utilizzando tipo complesso denominato "persona" in.
XML completo Schema di riferimento