XML Schema သမဂ္ဂ ဒြပ်စင်
❮ XML Schema ကိုးကားချက် အပြည့်အစုံ
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
union element သည် သတ်မှတ်ထားသော ရိုးရှင်းသောဒေတာအမျိုးအစားများမှ တန်ဖိုးများကို စုစည်းမှု (ယူနီယံ) အဖြစ် သတ်မှတ်သည်။
ဒြပ်စင်အချက်အလက်
- ပင်မ ဒြပ်စင်များ- ရိုးရိုးအမျိုးအစား
အထားအသို
<union
id=ID
memberTypes="list of QNames"
any attributes
>
(annotation?,(simpleType*))
</union>
( ? နိမိတ်သည် ပြည်ထောင်စုဒြပ်စင်အတွင်း သုည သို့မဟုတ် တစ်ကြိမ် ဖြစ်ပေါ်နိုင်ကြောင်း ကြေငြာသည်)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
memberTypes | Optional. Specifies a list of built-in data types or simpleType elements defined in a schema |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
ဥပမာ ၁
ဤဥပမာသည် ရိုးရှင်းသောအမျိုးအစားနှစ်ခု၏ ပြည်ထောင်စုတစ်ခုဖြစ်သည့် ရိုးရှင်းသောအမျိုးအစားကို ပြသသည်-
<xs:element name="jeans_size">
<xs:simpleType>
<xs:union memberTypes="sizebyno sizebystring" />
</xs:simpleType>
</xs:element>
<xs:simpleType name="sizebyno">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="42"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sizebystring">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
❮ XML Schema ကိုးကားချက် အပြည့်အစုံ