simpleType 정의에 대한 제약 조건을 정의합니다.
<restriction
base = QName
id = ID
{any attributes with non-schema Namespace}...>
Content: (annotation?, (simpleType?, (minExclusive | minInclusive |
maxExclusive | maxInclusive | totalDigits |fractionDigits | length |
minLength | maxLength | enumeration | whiteSpace | pattern)*))
</restriction>
특성
base
이 스키마 또는 지정된 네임스페이스가 나타내는 다른 스키마에 정의되어 있는 기본 제공 데이터 형식이나 simpleType 요소의 이름입니다. restriction 요소를 포함하는 요소는 base 값에 지정된 형식에서 파생됩니다.base 값은 정규화된 이름(QName)이어야 합니다.
필수 항목입니다.
id
이 요소의 ID입니다. id 값은 ID 형식이어야 하며 이 요소를 포함하는 문서 내에서 고유한 값이어야 합니다.선택적 항목입니다.
요소 정보
발생 횟수 |
한 번 |
부모 요소 |
|
내용 |
annotation, fractionDigits, enumeration, length, maxExclusive, maxInclusive, maxLength, minExclusive, minInclusive, minLength, pattern, simpleType, totalDigits, whiteSpace |
예제
다음 예제에서는 제한을 사용하는 단순 형식 정의를 보여 줍니다. 단순 형식은 nonNegativeInteger에서 파생되며 maxInclusive 값은 100
으로 설정됩니다.
<xs:simpleType name="freezeboilrangeInteger">
<xs:restriction base="xs:nonNegativeInteger">
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
예제
다음 예제에서는 integer 기본 제공 형식에서 파생되며 제한이 없이 모든 integer 패싯을 가진 단순 형식 정의를 보여 줍니다.
<xs:simpleType name="myInteger">
<xs:restriction base="xs:integer"/>
</xs:simpleType>
예제
다음 예제에서는 string에서 파생되며 열거 형식인 단순 형식 정의를 보여 줍니다. 값 집합은 지정된 값으로 제한됩니다.
<xs:simpleType name="mountainbikesize">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>