XML Schema Tuto...login
XML Schema Tutorial
author:php.cn  update time:2022-04-20 14:13:02

XML Schema Numeric Data Type



Decimal data type

The decimal data type is used to specify a value.

The following is an example of decimal number declaration in a scheme.

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

The elements in the document should look like this:

<prize>999.50</prize>

Or something like this:

<prize>+999.5450</prize>

Or similar to this:

<prize>-999.5230</prize>

Or similar to this:

<prize>0</prize>

Or something like this:

<prize>14</prize>

Note: The maximum number of decimal digits you can specify is 18 digits.

Integer data type

The integer data type is used to specify values ​​without decimal components.

The following is an example of integer declaration in a scheme.

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

The elements in the document should look like this:

<prize>999</prize>

Or something like this:

<prize>+999</prize>
Or similar to this:
<prize>-999</prize>

Or similar to this:

< ;prize>0</prize>

Numeric data type

Please note that all the following data types are derived from the decimal data type (Except decimal itself)!

##bytepositive or negative 8-bit integerdecimalDecimal numberint32-bit integer with positive and negative integerInteger valuelongA positive and negative 64-bit integernegativeIntegerIntegers containing only negative values ​​(.., -2, -1.)nonNegativeIntegerContains only non-negative integers (0, 1, 2, ..)nonPositiveIntegerContains only non-positive integers (.., - 2, -1, 0)positiveIntegerIntegers containing only positive values ​​(1, 2, ..)short16-bit integer with positive and negative signsunsignedLong64-bit integer with no positive and negative signsunsignedIntUnsigned 32-bit integerunsignedShortUnsigned 16-bit integerunsignedByteUnsigned 8-bit integer
NameSeconds

Restriction on numerical data types (Restriction)

Qualifications that can be used with numeric data types:

  • enumeration

  • fractionDigits

  • maxExclusive

  • maxInclusive

  • minExclusive

  • minInclusive

  • pattern

  • totalDigits

  • whiteSpace


php.cn