XML technologies / XML Schema / XML Schema element reference / xs:maxInclusive
(Excerpt from “XML Schema” by Eric van der Vlist)
Facet specifying an inclusive maximum value.
<xs:maxInclusive
fixed = xs:boolean : "false"
id = xs:ID
value = anySimpleType
{beliebige Attribute mit einem Nicht-Schema-Namensraum}
>
Content: (xs:annotation?)
</xs:maxInclusive>May occur within: xs:restriction (simple type), xs:restriction (simple content)
May be used as a facet for: xs:byte, xs:date, xs:dateTime, xs:decimal, xs:double, xs:duration, xs:float, xs:gDay, xs:gMonth, xs:gMonthDay, xs:gYear, xs:gYearMonth, xs:int, xs:integer, xs:long, xs:negativeInteger, xs:nonNegativeInteger, xs:nonPositiveInteger, xs:positiveInteger, xs:short, xs:time, xs:unsignedByte, xs:unsignedInt, xs:unsignedLong, xs:unsignedShort
Description
xs:maxInclusive specifies an inclusive maximum value. To be valid, a value must be less than the value of xs:maxInclusive or equal to it.
This facet affects the value space.
Restrictions
It is forbidden to define both xs:maxExclusive and xs:maxInclusive within the same restriction step. Although not explicitly stated in the recommendation, defining several xs:maxInclusive facets within one restriction step is also meaningless.
Within a restriction step, xs:maxInclusive also interacts with xs:minExclusive and xs:minInclusive, since inconsistent values produce data types with an empty value space.
xs:maxInclusive must restrict its base type’s value space, and the facet value must belong to that space.
Fixing the xs:maxInclusive facet does not fix the xs:maxExclusive facet. Use two restriction steps to define both facets, since applying both in the same step is forbidden.
Example
<xs:simpleType name="thousands">
<xs:restriction base="xs:double">
<xs:maxInclusive value="1e3"/>
</xs:restriction>
</xs:simpleType>Attributes
fixed
If the value is true, this facet’s value cannot be modified in further restrictions.
id
Element ID according to W3C XML Schema.
value
Facet value, which must belong to the base type’s value space.
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