XML 스키마 simpleType 요소
❮ 완전한 XML 스키마 참조
정의 및 사용
simpleType 요소는 단순 유형을 정의하고 속성 또는 텍스트 전용 요소의 값에 대한 정보와 제약 조건을 지정합니다.
요소 정보
- 상위 요소: 속성, 요소, 목록, 제한, 스키마, 공용체
통사론
<simpleType
id=ID
name=NCName
any attributes
>
(annotation?,(restriction|list|union))
</simpleType>
(? 기호는 요소가 simpleType 요소 내에서 0번 또는 1번 발생할 수 있음을 선언합니다)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
name | Specifies a name for the element. This attribute is required if the simpleType element is a child of the schema element, otherwise it is not allowed |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
실시예 1
이 예제는 제한이 있는 단순 유형인 "age"라는 요소를 정의합니다. age 값은 0보다 작거나 100보다 클 수 없습니다.
<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
❮ 완전한 XML 스키마 참조