五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 建站教程 > Schema 教程 > XML Schema choice 元素

XML Schema choice 元素

此節(jié)有 283 人學習過     參與評論

定義和用法

XML Schema 的 choice 元素僅允許包含在 <choice> 聲明中的元素之一出現(xiàn)在包含元素中。

元素信息

出現(xiàn)次數(shù) 在 group 和 complexType 元素中為一次;其他為無限制。
父元素 group、choice、sequence、complexType、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)
內(nèi)容 annotation、any、choice、element、group、sequence

語法

<choice
id=ID
maxOccurs=nonNegativeInteger|unbounded
minOccurs=nonNegativeInteger
any attributes
>

(annotation?,(element|group|choice|sequence|any)*)

</choice>

(? 符號聲明在 choice 元素中,元素可出現(xiàn)零次或一次,* 符號聲明元素可出現(xiàn)零次或多次。)

屬性 描述
id 可選。規(guī)定該元素的唯一的 ID。
maxOccurs 可選。規(guī)定 choice 元素在父元素中可出現(xiàn)的最大次數(shù)。該值可以是大于或等于零的整數(shù)。若不想對最大次數(shù)設置任何限制,請使用字符串 "unbounded"。 默認值為 1。
minOccurs 可選。規(guī)定 choice 元素在父元素中可出現(xiàn)的最小次數(shù)。該值可以是大于或等于零的整數(shù)。若要指定該 any 組是可選的,請將此屬性設置為零。 默認值為 1。
any attributes 可選。規(guī)定帶有 non-schema 命名空間的任何其他屬性。

實例

<xs:element name="person">
  <xs:complexType>
    <xs:choice>
      <xs:element name="employee" type="employee"/>
      <xs:element name="member" type="member"/>
    </xs:choice>
  </xs:complexType>
</xs:element>

上面的例子定義 "person" 元素必須包含一個 "employee" 元素或一個 "member" 元素。

如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答?。?點擊進入論壇

發(fā)表評論 (283人查看,0條評論)
請自覺遵守互聯(lián)網(wǎng)相關的政策法規(guī),嚴禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------
Schema 教程目錄

其它欄目

· 建站教程
· 365學習

業(yè)務咨詢

· 技術支持
· 服務時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權所有 鄂ICP備17013400號