当前位置: 首页 > 网络学院 > XML相关教程 > Schema (XSD) > XSD 小数数据类型

Schema (XSD)
XSD 逻辑值数据类型
XML Schema总结
XML Schema 参考
XSD 验证

Schema (XSD) 中的 XSD 小数数据类型


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 782 ::
收藏到网摘: n/a

Decimal data types are used for numeric values.
小数数据类型用于定义数值。


Decimal Data Type
小数数据类型

The decimal data type is used to specify a numeric value.
小数数据类型用于指定一个数值。

The following is an example of a decimal declaration in a schema:
下面列举了在schema关于小数声明的案例:

<xs:element name="prize" type="xs:decimal"/>

An element in your document might look like this:
在你的文档中,或许会包含下面这样一个元素:

<prize>999.50</prize>

Or it might look like this:
或者会像这样:

<prize>+999.5450</prize>

Or it might look like this:
又或者像这样:

<prize>-999.5230</prize>

Or it might look like this:
也可能是这样:

<prize>0</prize>

Or it might look like this:
当然,也有可能会是这样:

<prize>14</prize>

Note: The maximum number of decimal digits you can specify is 18.
注意:可以指定的小数位数最多是18位。


Integer Data Type
整数数据类型

The integer data type is used to specify a numeric value without a fractional component.
整数数据类型用于指定没有小数部分的数值。

The following is an example of an integer declaration in a schema:
下面是的关于整数在schema内声明方法的案例:

<xs:element name="prize" type="xs:integer"/>

An element in your document might look like this:
在你的文档中,也许会包含下述这样的元素:

<prize>999</prize>

Or it might look like this:
或着会是这样:

<prize>+999</prize>

Or it might look like this:
也可能是这样:

<prize>-999</prize>

Or it might look like this:
当然也会是这样:

<prize>0</prize>

 


Numeric Data Types
数字数据类型

Note that all of the data types below derive from the Decimal data type (except for decimal itself)!
注意:下面的所有数据类型都是从小数数据类型中派生出来的(小数自身除外)!

Name
名称
Description
解释
byte A signed 8-bit integer
指定一个最大8位的带符号整数
decimal A decimal value
指定一个小数数值
int A signed 32-bit integer
指定一个最大32位的带符号整数
integer An integer value
指定一个整数值
long A signed 64-bit integer
指定一个最大64位的带符号整数
negativeInteger An integer containing only negative values ( .., -2, -1.)
指定一个负值整数 ( .., -2, -1.)
nonNegativeInteger An integer containing only non-negative values (0, 1, 2, ..)
指定一个非负值整数 (0, 1, 2, ..)
nonPositiveInteger An integer containing only non-positive values (.., -2, -1, 0)
指定一个非正值整数 (.., -2, -1, 0)
positiveInteger An integer containing only positive values (1, 2, ..)
指定一个正值整数(1, 2, ..)
short A signed 16-bit integer
指定一个最大16位的带符号整数
unsignedLong An unsigned 64-bit integer
指定一个最大64位的不带符号整数
unsignedInt An unsigned 32-bit integer
指定一个最大32位的不带符号整数
unsignedShort An unsigned 16-bit integer
指定一个最大16位的不带符号整数
unsignedByte An unsigned 8-bit integer
指定一个最大8位的不带符号整数

 


Restrictions on Numeric Data Types
数字数据类型的约束

Restrictions that can be used with Numeric data types:
可用于约束数字数据的类型如下:

  • enumeration
    列举
  • fractionDigits
    小数位数
  • maxExclusive
    除去最大值
  • maxInclusive
    包括最大值
  • minExclusive
    除去最小值
  • minInclusive
    包括最小值
  • pattern
    式样
  • totalDigits
    总数字位数
  • whiteSpace
    空白

评论 (0) All

登陆 | 还没注册?