XML Schema ရိုးရှင်းသောအမျိုးအစား ဒြပ်စင်
❮ XML Schema ကိုးကားချက် အပြည့်အစုံ
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
simpleType ဒြပ်စင်သည် ရိုးရှင်းသောအမျိုးအစားကို သတ်မှတ်ပြီး attribute များ၏တန်ဖိုးများ သို့မဟုတ် စာသားသီးသန့်ဒြပ်စင်များဆိုင်ရာ ကန့်သတ်ချက်များနှင့် အချက်အလက်များကို သတ်မှတ်ပေးသည်။
ဒြပ်စင်အချက်အလက်
- ပင်မဒြပ်စင်များ- attribute၊ ဒြပ်စင်၊ စာရင်း၊ ကန့်သတ်ချက်၊ schema၊ union
အထားအသို
<simpleType
id=ID
name=NCName
any attributes
>
(annotation?,(restriction|list|union))
</simpleType>
( ? သင်္ကေတသည် ရိုးရိုးအမျိုးအစားဒြပ်စင်အတွင်း သုည သို့မဟုတ် တစ်ကြိမ် ဖြစ်ပွားနိုင်သည်ဟု ကြေငြာသည်)
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 |
ဥပမာ ၁
ဤဥပမာသည် ကန့်သတ်ချက်တစ်ခုပါသော ရိုးရှင်းသောအမျိုးအစားဖြစ်သည့် "အသက်" ဟုခေါ်သော ဒြပ်စင်တစ်ခုကို သတ်မှတ်ဖော်ပြသည်။ အသက်၏တန်ဖိုးသည် 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 Schema ကိုးကားချက် အပြည့်အစုံ