XML technologies / XML Schema / XML Schema element reference / xs:fractionDigits
(Excerpt from “XML Schema” by Eric van der Vlist)
Facet specifying a numeric data type’s decimal places.
<xs:fractionDigits
fixed = xs:boolean : "false"
id = xs:ID
value = xs:nonNegativeInteger
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?)
</xs:fractionDigits>May occur within: xs:restriction (simple type), xs:restriction (simple content)
May be used as a facet for: xs:decimal
Description
xs:fractionDigits specifies the maximum decimal places, digits after the decimal point, for data type xs:decimal.
This facet restricts the value space: decimal places are counted after conversion to canonical form and removal of trailing zeros.
Restrictions
Within a restriction step, xs:fractionDigits depends on xs:totalDigits, since inconsistent values produce data types with empty value spaces.
xs:fractionDigits must restrict the base type’s value space, and the specified value must be smaller than the corresponding base-type value if defined.
If needed, xs:pattern can restrict decimal places in the lexical space.
Example
<xs:simpleType name="fractionDigits">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="2"/>
</xs:restriction>
</xs:simpleType>Attributes
fixed
If the value is true, the facet’s value cannot be changed during further restriction.
id
Element ID according to W3C XML Schema.
value
Facet value.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de