XML technologies / XML Schema / Data type reference / xs:decimal

(Excerpt from “XML Schema” by Eric van der Vlist)

Decimal numbers

Derived from: xs:anySimpleType

Primitive type: xs:decimal

Known subtypes: xs:integer

Facets: xs:enumeration, xs:fractionDigits, xs:maxExclusive, xs:maxInclusive, xs:minExclusive, xs:minInclusive, xs:pattern, xs:totalDigits, xs:whiteSpace

Definition

<xs:simpleType name="decimal" id="decimal">
    <xs:restriction base="xs:anySimpleType">
        <xs:whiteSpace value="collapse" fixed="true"/>
    </xs:restriction>
</xs:simpleType>

Description

xs:decimal represents all decimal numbers of arbitrary length. Its lexical space permits any number of insignificant leading zeros, as well as insignificant trailing zeros after the decimal point.

Restrictions

The decimal separator is always a period (.), and no thousands separator is allowed. Exponential notation is unsupported.

Example

Valid values include: "123.456", "+1234.456", "-1234.456", "-.456" or "-456".

The following values would be invalid: "1 234.456" (spaces are forbidden), "1234.456E+2" (exponential notation, "E+2", is forbidden), "+ 1234.456" (spaces are forbidden) or "+1,234.456" (thousands separators are forbidden).

   

 

 

 

back to top