數位資料型別用於表示XML文件中的數位。
<xs:decimal>
資料型別用於表示數值。 它支援最多18位元的十進位制數。
<xs:decimal>範例
XSD中的元素宣告 -
<xs:element name = "score" type = "xs:decimal"/>
XML中的元素用法 -
<score>99.92</score>
<xs:integer>
資料型別用於表示整數值。
<xs:integer>範例
XSD中的元素宣告 -
<xs:element name = "score" type = "xs:integer"/>
XML中的元素用法 -
<score>999</score>
以下是常用數位資料型別的列表。
序號 | 型別 | 描述 |
---|---|---|
1 | byte |
帶符號的8 位整數 |
2 | decimal |
十進位制值 |
3 | int |
帶符號的32 位整數 |
4 | integer |
整數值 |
5 | long |
帶符號的64 位整數 |
6 | negativeInteger |
負值的整數 (如:-2 ,-1 ) |
7 | nonNegativeInteger |
非負值的整數(如:0 ,1 ,2 ) |
8 | nonPositiveInteger |
僅具有非正值的整數(如:-2 ,-1 ,0 ) |
9 | positiveInteger |
正值的整數(如:1 ,2 ) |
10 | short |
帶符號的16 位整數 |
11 | unsignedLong |
無符號64 位整數 |
12 | unsignedInt |
無符號32 位整數 |
13 | unsignedShort |
無符號16 位整數 |
14 | unsignedByte |
無符號8 位整數 |
以下型別的限制可以與日期資料型別一起使用 -
enumeration
fractionDigits
maxExclusive
maxInclusive
minExclusive
minInclusive
pattern
totalDigits
whiteSpace