XML Schema comprehensiveContent yuanzi
Ding yi he yong fa
comprehensiveContent yuanzi ding yi dui fuzha leixing ( bao han he xun huan nei rong huo zhi rong yuan zi) de chan shen huo xian zhi yuan zi.
Yuan zi xin xi
Chu xian ci shu | Yi ci |
Fu yuanzi | fuzha leixing |
Nei rong |
Ke xuan xiang. annotation Bi xuan xiang. You qing bing you yi ge zhong xia lei yuanzi: restriction ( comprehensiveContent ) huo extension ( comprehensiveContent ). |
Yu fa
<complexContent id=ID mixed=true|false any attributes > ( annotation ?, ( restriction | extension )) </complexContent>
(? fu hao sheng ming yuanzi ke yi zai fuzha yuanzi zhi nei chuxian ling ci huo yi ci.)
Shu xing | Shu mi |
---|---|
id | Xuanke. Gui ding zhe ge yuanzi de duyi de ID. |
mixed | Xuanke. Gui ding shi fu xu zai zhe ge fuzha leixing yuanzi zhi jian xian zai zi ju shu. Mu ban jia wei false. |
any attributes | Xuanke. Gui ding dai you non-schema ming ming hua ceng de ren he qi ta shu xing. |
Shili
Hanyan dake yuanyin de "fullpersoninfo" leixing, zhege fuzha leixing shi dui yichu de "personinfo" leixing, zhi xing san ge cangjie yuanze, cong gongyou de fuzha leixing "personinfo" yan sheng er gui lai de:
<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>
Koyarce In the above example, the "employee" element must sequentially contain the following elements: "firstname", "lastname", "address", "city", and "country".