여러 simpleType 정의의 컬렉션을 정의합니다.
<union
id = ID
memberTypes = List of QNames
{any attributes with non-schema Namespace}...>
Content: (annotation?, (simpleType*))
</union>
특성
id
이 요소의 ID입니다. id 값은 ID 형식이어야 하며 이 요소를 포함하는 문서 내에서 고유한 값이어야 합니다.선택적 항목입니다.
memberTypes
이 스키마 또는 지정된 네임스페이스에 나타난 다른 스키마에 정의되어 있는 기본 제공 데이터 형식이나 simpleType 요소 이름의 목록입니다. union 요소를 포함하는 simpleType 요소는 memberTypes 값에 지정된 단순 형식에서 파생됩니다. memberTypes의 값은 정규화된 이름(QNames)이어야 합니다.단순 형식 통합 정의의 경우 단순 형식 목록은 그 자체가 단순 형식 목록인 memberTypes의 내용과 각 simpleType 자식 요소 정의를 union 요소 아래 통합한 것입니다. 본 항목에 있는 두 번째 예제를 참조하십시오.
memberTypes 특성은 list 요소의 itemType 특성과 상반되며 list 요소는 자식 요소인 simpleType 요소와 상반됩니다.
선택적 항목입니다.
요소 정보
발생 횟수 |
한 번 |
부모 요소 |
|
내용 |
예제
다음 예제에서는 두 단순 형식의 union인 단순 형식을 보여 줍니다.
<xs:attribute name="fontsize">
<xs:simpleType>
<xs:union memberTypes="fontbynumber fontbystringname" />
</xs:simpleType>
</xs:attribute>
<xs:simpleType name="fontbynumber">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="72"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="fontbystringname">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
예제
다음 예제에서는 음이 아닌 모든 정수와 NMTOKEN "unbounded"의 통합인 단순 형식 정의를 보여 줍니다. 이 정의는 W3C XML Schema Part 1: Structures 사양의 스키마에 나와 있습니다.
<xs:simpleType name="allNNI">
<xs:annotation>
<xs:documentation>for maxOccurs</xs:documentation>
</xs:annotation>
<xs:union memberTypes="nonNegativeInteger">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="unbounded"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
관련 자료
자세한 내용은 www.w3.org/TR/2001/REC-xmlschema-1-20010502/\#element-all에 있는 Structures Recommendation을 참조하십시오.