XML Şeması simpleType Öğesi
❮ Eksiksiz XML Şeması Referansı
Tanım ve Kullanım
simpleType öğesi, basit bir türü tanımlar ve niteliklerin veya salt metin öğelerinin değerleriyle ilgili kısıtlamaları ve bilgileri belirtir.
Eleman Bilgileri
- Ana öğeler: nitelik, öğe, liste, kısıtlama, şema, birleşim
Sözdizimi
<simpleType
id=ID
name=NCName
any attributes
>
(annotation?,(restriction|list|union))
</simpleType>
(? işareti, öğenin simpleType öğesi içinde sıfır veya bir kez oluşabileceğini bildirir)
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 |
örnek 1
Bu örnek, kısıtlaması olan basit bir tür olan "yaş" adlı bir öğeyi tanımlar. Yaş değeri 0'dan küçük veya 100'den büyük olamaz:
<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>
❮ Eksiksiz XML Şeması Referansı