日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

中國最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2

xmlschema教程

XML Schema restriction 元素

閱讀 (1714)

XML Schema restriction 元素


XML Schema 參考手冊 完整 XML Schema 參考手冊

定義和用法

restriction 元素定義對 simpleType、simpleContent 或 complexContent 定義的約束。

元素信息

  • 父元素: simpleType, simpleContent, complexContent

語法

<restriction
id=ID
base=QName
any attributes
>

Content for simpleType:
(annotation?,(simpleType?,(minExclusive|minInclusive|
maxExclusive|maxInclusive|totalDigits|fractionDigits|
length|minLength|maxLength|enumeration|whiteSpace|pattern)*))

Content for simpleContent:
(annotation?,(simpleType?,(minExclusive |minInclusive|
maxExclusive|maxInclusive|totalDigits|fractionDigits|
length|minLength|maxLength|enumeration|whiteSpace|pattern)*)?,
((attribute|attributeGroup)*,anyAttribute?))

Content for complexContent:
(annotation?,(group|all|choice|sequence)?,
((attribute|attributeGroup)*,anyAttribute?))

</restriction>

(? 符號聲明在 restriction 元素中該元素可出現零次或一次。)

屬性 描述
id 可選。規定該元素的唯一的 ID。
base 必需。規定在該 schema(或由指定的命名空間指示的其他 schema)中定義的內建數據類型、simpleType 或 complexType 元素的名稱。
any attributes 可選。規定帶有 non-schema 命名空間的任何其他屬性。

實例 1

下面的例子定義了一個帶有約束且名為 "age" 的元素。age 的值不能小于 0 或大于 100:

<xs:element name="age">
??<xs:simpleType>
????<xs:restriction base="xs:integer">
??????<xs:minInclusive value="0"/>
??????<xs:maxInclusive value="100"/>
????</xs:restriction>
??</xs:simpleType>
</xs:element>

實例 2

本例定義了一個名為 "initials" 的元素。"initials" 元素是帶有約束的簡單類型。可接受的值是三個從 a 到 z 的大寫或小寫字母:

<xs:element name="initials">
??<xs:simpleType>
????<xs:restriction base="xs:string">
??????<xs:pattern value="[a-zA-Z][a-zA-Z][a-zA-Z]"/>
????</xs:restriction>
??</xs:simpleType>
</xs:element>

實例 3

本例定義了一個名為 "password" 元素。"password" 元素是帶有約束的簡單類型。值必須為最少 5 個字符且最多 8 個字符:

<xs:element name="password">
??<xs:simpleType>
????<xs:restriction base="xs:string">
??????<xs:minLength value="5"/>
??????<xs:maxLength value="8"/>
????</xs:restriction>
??</xs:simpleType>
</xs:element>

實例 4

本例展示了一個使用約束的復雜類型定義。復雜類型 "Chinese_customer" 從一個普通的 customer 復雜類型派生而來,其 country 元素的固定值是 "China":

<xs:complexType name="customer">
??<xs:sequence>
????<xs:element name="firstname" type="xs:string"/>
????<xs:element name="lastname" type="xs:string"/>
????<xs:element name="country" type="xs:string"/>
??</xs:sequence>
</xs:complexType>

<xs:complexType name="Norwegian_customer">
??<xs:complexContent>
????<xs:restriction base="customer">
??????<xs:sequence>
????????<xs:element name="firstname" type="xs:string"/>
????????<xs:element name="lastname" type="xs:string"/>
????????<xs:element name="country" type="xs:string" fixed="Norway"/>
??????</xs:sequence>
????</xs:restriction>
??</xs:complexContent>
</xs:complexType>


XML Schema 參考手冊 完整 XML Schema 參考手冊
關閉
程序員人生
主站蜘蛛池模板: 久久久91精品国产一区二区三区 | 成人免费在线观看 | 色污污| 超碰久热 | 国产成人精品自拍 | 久一久久 | 国产精品免费在线播放 | 麻豆精品国产91久久久久久 | 美日韩一区二区 | 91夜夜蜜桃臀一区二区三区 | 亚洲精品自拍 | 国产一区福利 | 国产免费成人av | 女人18毛片九区毛片在线 | 在线看的av | 亚洲午夜网 | 99久久这里只有精品 | av看片| 欧美日韩国产精品一区二区 | 一区二区三区精品在线 | 99re视频在线观看 | 亚洲日本国产 | 一级aaa级毛片午夜在线播放 | 色婷婷综合成人 | 国产精品久久久久久久久免费相片 | 国产亚州av| 成人国产精品久久 | 亚洲欧美日韩系列 | 99精品视频在线观看免费 | 成人精品毛片 | 一区二区视频在线 | 疯狂做受xxxx国产 | 99av在线 | 久久久综合色 | 在线麻豆av | 91亚洲精品中文字幕 | 国产亚洲欧美在线 | 国产精品视频一二三区 | 精品在线不卡 | 精品国产一区二区三区久久久 | 欧美成人精品一区 |