XML Schema complexType အက်ဥပဒါ

အသုံးပြုခြင်းနှင့်အသုံးချမှု

complexType အက်ဥပဒါ အပါအဝင်အရာကို အသုံးပြုသည်။ အပါအဝင်အရာကို အပါအဝင်အရာနှင့်/သို့မဟုတ် အချက်အလက်များကို ပါဝင်သည်။

အက်ဥပဒါအချက်

ပေါ်ပေါက်သည့်ပုံ အဆိုပါအဆိုင်ရာတွင်အခွင့်ထူးသည်;အက်ဥပဒါတွင်တစ်ကြိမ်သာဖြစ်သည်。
ပုဂ္ဂိုလ်တိုက် element、redefine、schema
ပါဝင်သောအရာ annotation、simpleContent、complexContent、group、all、choice、sequence、attribute、attributeGroup、anyAttribute

အက္ခရာ

<complexType
id=ID 
name=NCName 
abstract=true|false 
mixed=true|false
block=(#all|list of (extension|restriction))
final=(#all|list of (extension|restriction))
အခြား အချက်အလက်
>
(annotation?,(simpleContent|complexContent|((group|all| 
choice|sequence)?,((attribute|attributeGroup)*,anyAttribute?))))
</complexType>

(? အစားအားပေးခြင်း ကို complexType အရာတွင် အမှတ်ပြုထားသည်၊ အရာသည် အပိုင်းအခြား ဖြစ်နိုင်သည်၊ * အစားအားပေးခြင်း ကို အပိုင်းအခြား ဖြစ်နိုင်သည်。)

အခြေအနေ

id

ဆိုင်းပါး။ ဒီ အရာ၏ ကိုယ်တိုင်း ID ကို အမှတ်ပြုပါ။

name

ဆိုင်းပါး။ အရာ၏ အမည်ကို အမှတ်ပြုပါ။

abstract

ဆိုင်းပါး။ ဒီ complexType အရာ၏ အသုံးပြုခြင်း အတွက် သုံးနိုင်သလို မသုံးနိုင်သလို အမှတ်ပြုပါ။ အရာကို true အရာဖြစ်လျှင် အရာသည် အမှတ်ပြုထားသော complexType အရာကို မအသုံးပြုလိုက်သည်၊ သို့တည်းမဟုတ် ဒီ complexType အရာမှ ပေါ်ထွက်လာသော complexType အရာကို အသုံးပြုပါ။ ပုံစံအရ အမှတ်ပြုချက်သည် false ဖြစ်ပါ။

mixed

ဆိုင်းပါး။ ဒီ complexType အရာ၏ လျှောက်အရာအကြားတွင် အက္ခရာ အချက်အလက်များ ပေါ်ထွက်လိုက်သည်ကို ခွင့်ပြုလိုက်သလို တားမြစ်လိုက်သလို အမှတ်ပြုပါ။ ပုံစံအရ အမှတ်ပြုချက်သည် false ဖြစ်ပါ။

  • အကယ်၍ simpleContent အရာသည် လျှောက်အရာ ဖြစ်လျှင် mixed အရာကို မမူကြုံပါ။
  • အကယ်၍ complexContent အရာသည် လျှောက်အရာ ဖြစ်လျှင် complexContent အရာ၏ mixed အရာကို ကျွမ်းကျွမ်းပြီး အမှတ်ပြုနိုင်ပါ။

block

ဆိုင်းပါး။ သတ်မှတ်ထားသော ပေါ်ထွက်လာမှု အမျိုးအစားကို အစားထိုးလိုက်သော complexType အရာကို တားမြစ်ပါ။ ဒီ အရာသည် #all သို့မဟုတ် ပြင်းပြင်းထန်သော စာရင်းသွင်းများ ပါဝင်နိုင်ပါ။ ဒီ စာရင်းသွင်းများသည် extension သို့မဟုတ် restriction အစားအားပေးခြင်း ပါဝင်နိုင်ပါ။

  • extension - ဒီ complexType အရာကို အစားထိုးလိုက်သော ပေါ်ထွက်လာမှုများ အား တားမြစ်ပါ။
  • restriction - ဒီ complexType အရာကို အစားထိုးလိုက်သော ပေါ်ထွက်လာမှုများ အား တားမြစ်ပါ။
  • #all - ဒီ complexType အရာကို အစားထိုးလိုက်သော ပေါ်ထွက်လာမှုများ အား တားမြစ်ပါ။

final

ဆိုင်းပါး။ ဒီ complexType အရာမှ သတ်မှတ်ထားသော အမျိုးအစားများ မှ ပေါ်ထွက်လာမှုကို တားမြစ်ပါ။ ဒီ အရာသည် #all သို့မဟုတ် ပြင်းပြင်းထန်သော စာရင်းသွင်းများ ပါဝင်နိုင်ပါ။ ဒီ စာရင်းသွင်းများသည် extension သို့မဟုတ် restriction အစားအားပေးခြင်း ပါဝင်နိုင်ပါ။

  • extension - ကြွင်းတင်ခ�င်း အပေါ် အားပေးတော်မူသည်。
  • restriction - ကြွင်းတင်ခြင်း အပေါ် အားပေးတော်မူသည်。
  • #all - ကြွင်းတင်ခြင်း အပေါ် အားပေးတော်မူသည်。

အခြား အချက်အလက်

အပိုင်းစံ အသံထွက် အကြောင်းအရာ

အကြောင်း

အကြောင်းအရာ

အကြောင်းအရာ 1

<xs:element name="note">
    <xs:complexType>
      <xs:sequence>
	<xs:element name="to" type="xs:string"/>
	<xs:element name="from" type="xs:string"/>
	<xs:element name="heading" type="xs:string"/>
	<xs:element name="body" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
</xs:element>

အကြောင်းအရာ 1

အကြောင်းအရာ 2

<xs:element name="employee" type="fullpersoninfo"/>
<xs:complexType name="personinfo">
  <xs:sequence>
    <xs:element name="firstname" type="xs:string"/>
    <xs:element name="lastname" type="xs:string"/>
  </xs:sequence>
</xs:complexType>
<xs:complexType name="fullpersoninfo">
  <xs:complexContent>
    <xs:extension base="personinfo">
      <xs:sequence>
        <xs:element name="address" type="xs:string"/>
        <xs:element name="city" type="xs:string"/>
        <xs:element name="country" type="xs:string"/>
      </xs:sequence>
    </xs:extension>
  </xs:complexContent>
</xs:complexType>

အထူးသတင်း အချက်အလက်များ တွင် အရေးပါသော "employee" အကွက် သည် အဆက်အသွယ် အပါအဝင် နောက်ဆုံး အကွက် မှ အရေးပါသော အကွက် အပါအဝင် ပါရှိသည် - "firstname", "lastname", "address", "city" နှင့် "country"。