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

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

XML Schema redefine 元素

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

定義和用法

redefine 元素允許在當(dāng)前 Schema 中重新定義從外部架構(gòu)文件中獲取的簡(jiǎn)單和復(fù)雜類型、組和屬性組。

元素信息

出現(xiàn)次數(shù) 無限制
父元素 schema
內(nèi)容 annotation、attributeGroup、complexType、group、simpleType

語法

<redefine
id=ID
schemaLocation=anyURI
any attributes
>

(annotation|(simpleType|complexType|group|attributeGroup))*

</redefine>
屬性 描述
id 可選。規(guī)定該元素的唯一的 ID。
schemaLocation 必需。對(duì) schema 文檔位置的 URI 引用。
any attributes 可選。規(guī)定帶有 non-schema 命名空間的任何其他屬性。

實(shí)例

例子 1

下面的例子展示了一個(gè) schema,Myschama2.xsd,其中存在由 Myschama1.xsd 規(guī)定的元素。pname 類型被重新定義。根據(jù)此 schema,被 pname 約束的元素必須以 "country" 元素結(jié)束:

Myschema1.xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="pname">
  <xs:sequence>
    <xs:element name="firstname"/>
    <xs:element name="lastname"/>
  </xs:sequence>
</xs:complexType>

<xs:element name="customer" type="pname"/>

</xs:schema>

Myschema2.xsd:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:redefine schemaLocation="Myschema1.xsd">
  <xs:complexType name="pname">
    <xs:complexContent>
      <xs:extension base="pname">
        <xs:sequence>
          <xs:element name="country"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:redefine>

<xs:element name="author" type="pname"/>

</xs:schema>

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

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

其它欄目

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

業(yè)務(wù)咨詢

· 技術(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)