XML Schema simpleType 元素

定义和用法

simpleType 元素定义一个简单类型,规定与具有纯文本内容的元素或属性的值有关的信息以及对它们的约束。

元素信息

出现次数 无限制
父元素 attribute、element、list、restriction (simpleType)、schema、union
内容 annotation、list、restriction (simpleType)、union

语法

အအုပ်အချုပ်
>
(annotation?,(restriction|list|union))

(? 符号声明元素可在 simpleType 元素中出现零次或一次。)

属性 描述
id 可选。规定该元素的唯一的 ID。
name

类型名称。 该名称必须是在 XML 命名空间规范中定义的无冒号名称 (NCName)。

如果指定,该名称在所有 simpleType 和 complexType 元素之间必须是唯一的。

如果 simpleType 元素是 schema 元素的子元素,则为必选项,在其他时候则是不允许的。

အအုပ်အချုပ် လုံလောက်သည်။ သတ်မှတ်ထားသော non-schema အအုပ်အချုပ် အချုပ် တစ်ခု ကို ခွင့်ပြုသည်။

အကြောင်း

ဘာသာ 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>