XML Schema မှ Element အားလုံး
❮ XML Schema အကိုးအကားကို အပြီးသတ်ပါ။
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
ဒြပ်စင်အားလုံးသည် ကလေးဒြပ်စင်များသည် မည်သည့်အစီအစဥ်တွင်မဆို ပေါ်လာနိုင်ပြီး ကလေးဒြပ်စင်တစ်ခုစီသည် သုည သို့မဟုတ် တစ်ကြိမ်သာ ဖြစ်ပေါ်နိုင်ကြောင်း သတ်မှတ်သည်။
ဒြပ်စင်အချက်အလက်
- ပင်မ ဒြပ်စင်များ- အုပ်စု၊ ရှုပ်ထွေးသောအမျိုးအစား၊ ကန့်သတ်ချက် (ရိုးရှင်းသောအကြောင်းအရာနှင့် ရှုပ်ထွေးသောအကြောင်းအရာနှစ်ခုလုံး)၊ တိုးချဲ့မှု (ရိုးရှင်းသောအကြောင်းအရာနှင့် ရှုပ်ထွေးသောအကြောင်းအရာနှစ်ခုလုံး)
အထားအသို
<all
id=ID
maxOccurs=1
minOccurs=0|1
any attributes
>
(annotation?,element*)
</all>
( ? နိမိတ်သည် ဒြပ်စင်သည် သုည သို့မဟုတ် တစ်ကြိမ် ဖြစ်ပေါ်နိုင်ကြောင်း ကြေငြာပြီး * သင်္ကေတသည် ဒြပ်စင်အားလုံးအတွင်းရှိ သုည သို့မဟုတ် ထို့ထက်ပိုသော အကြိမ်များ ဖြစ်ပေါ်နိုင်ကြောင်း ကြေငြာသည်)
Attribute | Description |
---|---|
id | Optional. Specifies a unique ID for the element |
maxOccurs | Optional. Specifies the maximum number of times the element can occur. The value must be 1. |
minOccurs | Optional. Specifies the minimum number of times the element can occur. The value can be 0 or 1. Default value is 1 |
any attributes | Optional. Specifies any other attributes with non-schema namespace |
ဥပမာ ၁
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:all>
</xs:complexType>
</xs:element>
အထက်ဖော်ပြပါ ဥပမာတွင် "firstname" နှင့် "lastname" ဒြပ်စင်များသည် မည်သည့်အစီအစဥ်တွင်မဆို ပေါ်လာနိုင်သော်လည်း ဒြပ်စင်နှစ်ခုစလုံးသည် တစ်ကြိမ်နှင့်တစ်ကြိမ်သာ ဖြစ်ပေါ်ရမည်ဟု ဖော်ပြထားပါသည်။
ဥပမာ ၂
<xs:element name="person">
<xs:complexType>
<xs:all>
<xs:element name="firstname" type="xs:string" minOccurs="0"/>
<xs:element name="lastname" type="xs:string" minOccurs="0"/>
</xs:all>
</xs:complexType>
</xs:element>
အထက်ဖော်ပြပါ ဥပမာတွင် "firstname" နှင့် "lastname" ဒြပ်စင်များသည် မည်သည့်အစီအစဥ်တွင်မဆို ပေါ်လာနိုင်ပြီး ဒြပ်စင်တစ်ခုစီသည် သုည သို့မဟုတ် တစ်ကြိမ်သာ ပေါ်လာနိုင်သည်ကို ဖော်ပြသည်။
❮ XML Schema အကိုးအကားကို အပြီးသတ်ပါ။