XML Schema内置简单类型
Simple Type |
Examples (delimited by commas) |
Notes |
||
Confirm this is electric |
||||
Confirm this is electric |
see (3) |
|||
Confirm this is electric |
see (4) |
|||
GpM7 |
|
|||
0FB7 |
|
|||
...-1,1,... |
see (2) |
|||
1,2,... |
see (2) |
|||
... -2,-1 |
see (2) |
|||
0,... |
see (2) |
|||
... -2,-1,0 |
see (2) |
|||
-9223372036854775808,... -1,... 9223372036854775807 |
see (2) |
|||
0,... 18446744073709551615 |
see (2) |
|||
-2147483648,... 2147483647 |
see (2) |
|||
0,...4294967295 |
see (2) |
|||
-32768,... 32767 |
see (2) |
|||
0,... 65535 |
see (2) |
|||
-128,...-1,... 127 |
see (2) |
|||
0,... 255 |
see (2) |
|||
-1.23,123.4,1000.00 |
see (2) |
|||
-INF,-1E4,-0,12.78E-2,12,INF,NaN |
equivalent to single-precision 32-bit floating point,NaN is "not a number",see (2) |
|||
-INF,NaN |
equivalent to double-precision 64-bit floating point,see (2) |
|||
true,false,0 |
||||
P1Y2M3DT10H30M12.3S |
1 year,2 months,3 days,10 hours,30 minutes,and 12.3 seconds |
|||
1999-05-31T13:20:00.000-05:00 |
May 31st 1999 at 1.20pm Eastern Standard Time which is 5 hours behind Co-Ordinated Universal Time,see (2) |
|||
1999-05-31 |
see (2) |
|||
13:20:00.000,13:20:00.000-05:00 |
see (2) |
|||
1999 |
1999,see (2) (5) |
|||
1999-02 |
the month of February 1999,regardless of the number of days,see (2) (5) |
|||
--05 |
May,see (2) (5) |
|||
--05-31 |
every May 31st,see (2) (5) |
|||
---31 |
the 31st day,see (2) (5) |
|||
shipTo |
XML 1.0 Name type |
|||
po:USAddress |
XML Namespace QName |
|||
USAddress |
XML Namespace NCName,i.e. a QName without the prefix and colon |
|||
|
||||
en-GB,en-US,fr |
valid values for xml:lang as defined in XML 1.0 |
|||
XML 1.0 ID attribute type,see (1) |
||||
XML 1.0 IDREF attribute type,see (1) |
||||
XML 1.0 IDREFS attribute type,see (1) |
||||
XML 1.0 ENTITY attribute type,see (1) |
||||
XML 1.0 ENTITIES attribute type,see (1) |
||||
XML 1.0 NOTATION attribute type,see (1) |
||||
|
XML 1.0 NMTOKEN attribute type,see (1) |
|||
|
XML 1.0 NMTOKENS attribute type,i.e. a whitespace separated list of NMTOKEN's,see (1) |
|||
Notes: (1) To retain compatibility between XML Schema and XML 1.0 DTDs,the simple types ID,IDREF,IDREFS,ENTITY,ENTITIES,NOTATION,NMTOKEN,NMTOKENS should only be used in attributes. (2) A value of this type can be represented by more than one lexical format,e.g. 100 and 1.0E2 are both valid float formats representing "one hundred". However,rules have been established for this type that define a canonical lexical format,see |
一.基于字符串的类型
1.
2.
3.
4.
5.
|
二.数字类型
1.
可使用科学计数法表示;下列值都是有效的:INF(无穷大),-INF(负无穷大)、0(正零)、-0(负零)和NaN(非数字);注:正零大于负零,非数字大于所有其他值,包括正无穷大。
2.
表示任意精度的小数,不同的模式处理器支持的有效位数是不一样的,不过需要最少支持18位有效数字。
.2 和2.以及002和2.00是符合标准的decimal数字。
3.
派生自decimal,表示一任意大的证书,从integer数据类型派生出了其他十二种内置类型,例如Byte,Int等。
三.日期和时间类型
1.
若要表示公园前的年,可以在年之前面添加减号例如-0343-03-22表示公元前343年3月22日。
可以在日期值后添加可选的时区表达式,或者添加字符Z,表示UTC时间。例如:1978-05-04+08:00
2.
3.
4.
5.
6.
7.
8.
9.
年月日小时分钟数都可以是任意的无符号整数,而秒数则可以是任意的无符号小数,除此之外,duration的值还遵循下列的规则:
l
l
l
l
四.其他数据类型
1.boolean有效值为0,1,true,false。
2.anyURI表示同意资源标识符的引用。
3.QName表示XML名称空间限定名,包括一个前缀名一个本地部分,中间用冒号分割,这两部分都是NCName类型。前缀和冒号都是可选的,但是如果使用了前缀,则要求在QName值得适用范围内使用该前缀变量的名称空间的声明,否则将出错。