XML Schema ဆင့် ကဲဒြပ်စင်
❮ XML Schema ကိုးကားချက် အပြည့်အစုံ
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဆင့်ကဲဒြပ်စင်သည် ကလေးဒြပ်စင်များကို စီစဉ်တစ်ခုတွင် ပေါ်လာရမည်ဟု သတ်မှတ်သည်။ ကလေးဒြပ်စင်တစ်ခုစီသည် 0 မှ မည်သည့်အကြိမ်ရေအထိ ဖြစ်ပေါ်နိုင်သည်။
ဒြပ်စင်အချက်အလက်
- ပင်မ ဒြပ်စင်များ- အုပ်စု၊ ရွေးချယ်မှု၊ အတွဲလိုက်၊ ရှုပ်ထွေးသောအမျိုးအစား၊ ကန့်သတ်ချက် (ရိုးရှင်းသောအကြောင်းအရာနှင့် ရှုပ်ထွေးသောအကြောင်းအရာနှစ်ခုလုံး)၊ တိုးချဲ့မှု (ရိုးရှင်းသောအကြောင်းအရာနှင့် ရှုပ်ထွေးသောအကြောင်းအရာနှစ်ခုလုံး)
အထားအသို
<sequence
id=ID
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
any attributes
>
(annotation?,(element|group|choice|sequence|any)*)
</sequence>
( ? အမှတ်အသားသည် အစီစဉ်ဒြပ်စင်အတွင်း သုည သို့မဟုတ် တစ်ကြိမ် ဖြစ်ပေါ်နိုင်ကြောင်း ကြေငြာသည်)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the sequence element can occur in the parent element. The value can be any number >= 0, or if you want to set no limit on the maximum number, use the value "unbounded". Default value is 1 |
minOccurs | Optional. Specifies the minimum number of times the sequence element can occur in the parent element. The value can be any number >= 0. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
ဥပမာ ၁
ဤဥပမာတွင် အောက်ပါဒြပ်စင်ငါးခုပါရှိရမည့် "personinfo" ဟုခေါ်သော ဒြပ်စင်တစ်ခုအတွက် ကြေငြာချက်ကို ပြသသည်; "firstname", "lastname", "address", "မြို့" နှင့် "country":
<xs:element name="personinfo">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
ဥပမာ ၂
ဤနမူနာတွင် အောက်ပါဒြပ်စင် သုည သို့မဟုတ် ထို့ထက်ပိုသော အစိတ်အပိုင်းများ၊ ခွေးနှင့်ကြောင်၊ အတွဲလိုက်ဒြပ်စင်တွင် "အိမ်မွေးတိရစ္ဆာန်များ" ဟုခေါ်သော ဒြပ်စင်တစ်ခုအတွက် ကြေငြာချက်ကို ပြသသည်-
<xs:element name="pets">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="dog" type="xs:string"/>
<xs:element name="cat" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
❮ XML Schema ကိုးကားချက် အပြည့်အစုံ