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

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

XML Schema all 元素

此節(jié)有 298 人學(xué)習(xí)過(guò)     參與評(píng)論

定義和用法

all 元素規(guī)定子元素能夠以任意順序出現(xiàn),每個(gè)子元素可出現(xiàn)零次或一次。

元素信息

出現(xiàn)次數(shù) 一次
父元素 group、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)、complexType
內(nèi)容 annotation、element

語(yǔ)法

<all
id=ID
maxOccurs=1
minOccurs=0|1
any attributes
>

(annotation?,element*)

</all>

(? 符號(hào)聲明該元素可出現(xiàn)零次或一次,而 * 符號(hào)聲明該元素可在所有元素中出現(xiàn)零次或多次。)

屬性 描述
id 可選。該元素的唯一標(biāo)識(shí)符。
maxOccurs 可選。元素可出現(xiàn)的最大次數(shù)。 該值必須是 1。
minOccurs 可選。元素可出現(xiàn)的最小次數(shù)。 該值可以是整數(shù) 0 或 1。若要指定該元素是可選的,請(qǐng)將該屬性設(shè)置為 0。 默認(rèn)值為 1。
any attributes 可選。規(guī)定帶有 non-schema 命名空間的任何其他屬性。

例子 1

<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" 元素能夠以任何順序出現(xiàn),兩個(gè)元素都必須且只能出現(xiàn)一次!

例子 2

<xs:element name="person">
  <xs:complexType>
    <xs:all minOccurs="0">
      <xs:element name="firstname" type="xs:string"/>
      <xs:element name="lastname" type="xs:string"/>
    </xs:all>
  </xs:complexType>
</xs:element>

上面的例子指示 "firstname" 和 "lastname" 元素能夠以任何順序出現(xiàn),每個(gè)元素都能出現(xiàn)零次或一次!

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

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

其它欄目

· 建站教程
· 365學(xué)習(xí)

業(yè)務(wù)咨詢(xún)

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

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

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號(hào)