elemento de esquema XML attributeGroup
Definición y Uso
attributeGroup elemento se utiliza para declarar atributos se combinan, de manera que estas declaraciones se pueden combinar para formar al tipo complejo.
elemento de información
- Elemento principal: attributeGroup, tipoCompuesto, esquema de restricción (tanto simpleContent y complexContent), extensión (tanto simpleContent y complexContent)
gramática
<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>
(? Iniciar declara attributeGroup elemento, el elemento puede aparecer cero o una vez, * signo declara que el elemento puede aparecer cero o más veces.)
属性 | 描述 |
---|---|
id | 可选。规定该元素的唯一的 ID。 |
name | 可选。规定属性组的名称。name 和 ref 属性不能同时出现。 |
ref | 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。 |
any attributes | 可选。规定带有 non-schema 命名空间的任何其他属性。 |
Ejemplo 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>
El ejemplo anterior define un grupo propiedad denominada "personattr" usando tipo complejo llamado "persona" en.
XML completo esquema de referencia