w3pop.com :: ÍøÂçѧԺ :: Schema (XSD) :: XSD СÊýÊý¾ÝÀàÐÍ
Decimal data types are used for numeric values.
СÊýÊý¾ÝÀàÐÍÓÃÓÚ¶¨ÒåÊýÖµ¡£
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λ¡£
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> |
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 that can be used with Numeric data types:
¿ÉÓÃÓÚÔ¼ÊøÊý×ÖÊý¾ÝµÄÀàÐÍÈçÏ£º
ÆÀÂÛ (0)
All