XML 스키마 속성 그룹 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
attributeGroup 요소는 속성 선언 집합을 그룹화하여 복잡한 유형 정의에 그룹으로 통합할 수 있도록 하는 데 사용됩니다.
요소 정보
- 상위 요소: attributeGroup, complexType, 스키마, 제한(simpleContent 및 complexContent 모두), 확장(simpleContent 및 complexContent 모두)
통사론
<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>
(annotation?),((attribute|attributeGroup)*,anyAttribute?))
</attributeGroup>
(? 기호는 요소가 0번 또는 1번 발생할 수 있음을 선언하고 * 기호는 요소가 attributeGroup 요소 내에서 0번 이상 발생할 수 있음을 선언합니다)
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 |
실시예 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>
위의 예는 "person"이라는 복합 유형에서 사용되는 "personattr"이라는 속성 그룹을 정의합니다.
❮ 완전한 XML 스키마 참조