<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 431,  comments - 344,  trackbacks - 0

     

    對一組值的約束(使用枚舉)
    下述案例給名為"car"的元素定義了約束條件,符合條件的值有:Audi、Golf、BMW:
    <xs:element name="car">

    <xs:simpleType>
     <xs:restriction base="xs:string">
        <xs:enumeration value="Audi"/>
        <xs:enumeration value="Golf"/>
        <xs:enumeration value="BMW"/>
     </xs:restriction>
    </xs:simpleType>

    </xs:element>  

    對一系列值的約束 

    下述案例給名為"letter"的元素定義了約束條件。唯一符合條件的值是從 a 到 z 之間的一個小寫字母:

    <xs:element name="letter">

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:pattern value="[a-z]"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    下述案例給名為"gender"的元素定義了一個約束條件。唯一符合的值是male (男性)或female(女性):

    <xs:element name="gender">

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:pattern value="male|female"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    對空白符的約束

    下述案例給名為"address"的元素定義了一個約束條件??瞻追O置為"preserve"(保留),這意味著XML處理器不會刪除任何空白符:

    <xs:element name="address">

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:whiteSpace value="preserve"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    下述案例給名為"address"的元素定義了一個約束條件。空白符設置為" replace "(替代),這意味著XML處理器會用空格替代所有的空白字符(其中包括:換行符、制表符、空格符、回車符):

    <xs:element name="address">

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:whiteSpace value="replace"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    下述案例給名為"address"的元素定義了一個約束條件。空白符設置為"collapse"(清除),這意味著XML處理器會清除所有的空白字符(換行符、制表符、空格符以及回車符都被空格符替代。頭部、尾部的空格會被清除,多個空格也會自動減少為一個):

    <xs:element name="address">

    <xs:simpleType>

    <xs:restriction base="xs:string">

    <xs:whiteSpace value="collapse"/>

    </xs:restriction>

    </xs:simpleType>

    </xs:element>

    對數據類型的約束

    Constraint
    約束

    Description
    說明

    enumeration

    Defines a list of acceptable values
    定義了一系列的有效值

    fractionDigits

    Specifies the maximum number of decimal places allowed. Must be equal to or greater than zero
    指定了允許出現的小數位數的最大位數。值必須大于等于0

    length

    Specifies the exact number of characters or list items allowed. Must be equal to or greater than zero
    指定了允許出現的字符或列表項的個數。值必須大于等于0

    maxExclusive

    Specifies the upper bounds for numeric values (the value must be less than this value)
    指定了數值上限(數值必須小于該值)

    maxInclusive

    Specifies the upper bounds for numeric values (the value must be less than or equal to this value)
    指定了數值上限(數值必須小于等于該值)

    maxLength

    Specifies the maximum number of characters or list items allowed. Must be equal to or greater than zero
    指定了允許出現的字符或列表項的最大個數。值必須大于等于0

    minExclusive

    Specifies the lower bounds for numeric values (the value must be greater than this value)
    指定了數值的下限 (數值必須大于該值)

    minInclusive

    Specifies the lower bounds for numeric values (the value must be greater than or equal to this value)
    指定了數值的下限(數值必須大于等于該值)

    minLength

    Specifies the minimum number of characters or list items allowed. Must be equal to or greater than zero
    指定了允許出現的字符或列表的最小個數。值必須大于等于0

    pattern

    Defines the exact sequence of characters that are acceptable
    定義了符合要求的字符的精確排列順序

    totalDigits

    Specifies the exact number of digits allowed. Must be greater than zero
    指定了允許出現的字符的精確個數。值必須大于0

    whiteSpace

    Specifies how white space (line feeds, tabs, spaces, and carriage returns) is handled
    指定了空白符的處理方式(其中包括:換行符、制表符、空格符和回車符)

    posted on 2008-03-29 12:44 周銳 閱讀(872) 評論(0)  編輯  收藏 所屬分類: JavaXML
    主站蜘蛛池模板: 97在线线免费观看视频在线观看| 亚洲欧洲精品久久| 国产在线ts人妖免费视频| 免费在线观看h片| 2022久久国产精品免费热麻豆| 美女被免费网站91色| 日日狠狠久久偷偷色综合免费| 色婷婷六月亚洲综合香蕉| 亚洲一区免费在线观看| 亚洲美女视频一区二区三区| 亚洲Av无码精品色午夜| 亚洲精品成人无限看| 亚洲精品无码久久一线| 亚洲精品乱码久久久久66| 久久乐国产精品亚洲综合| 亚洲性在线看高清h片| 亚洲视频在线免费| 亚洲永久精品ww47| 久久亚洲国产精品成人AV秋霞 | 亚洲国产国产综合一区首页| 亚洲宅男天堂在线观看无病毒| 亚洲国产成人精品女人久久久| 国产一级大片免费看| 免费大黄网站在线看| 免费大片在线观看网站| 日本特黄特色aa大片免费| 日韩免费在线观看| 国产成人在线免费观看| 亚洲第一区精品日韩在线播放| 亚洲精品无码久久久久AV麻豆| 免费中文字幕不卡视频| 国产亚洲AV手机在线观看| 免费午夜爽爽爽WWW视频十八禁| 国产免费久久精品久久久| 国产精品亚洲w码日韩中文| 国产hs免费高清在线观看| ZZIJZZIJ亚洲日本少妇JIZJIZ | 国产成人综合亚洲亚洲国产第一页| 亚洲精品无码AV人在线播放| 亚洲国产精品成人精品无码区在线| 婷婷久久久亚洲欧洲日产国码AV|