XML technologies / XML Schema / XML Schema element reference / xs:maxExclusive

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

Facet specifying an exclusive maximum value.

<xs:maxExclusive
    fixed = xs:boolean : "false"
    id = xs:ID
    value = anySimpleType
    {beliebige Attribute mit einem Nicht-Schema-Namensraum}
    >
    Content: (xs:annotation?)
</xs:maxExclusive>

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:maxExclusive specifies an exclusive maximum value. To be valid, a value must be strictly less than the value of xs:maxExclusive.

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:maxExclusive facets within one restriction step is also meaningless.

Within a restriction step, xs:maxExclusive also interacts with xs:minExclusive and xs:minInclusive, since inconsistent values produce data types with empty value spaces.

xs:maxExclusive must restrict its base type’s value space, and the facet value must belong to that space.

Fixing the xs:maxExclusive facet does not fix the xs:maxInclusive facet. Use two restriction steps to define both facets, since applying both in the same step is forbidden.

Example

<xs:simpleType name="myInteger">
    <xs:restriction base="xs:integer">
        <xs:minInclusive value="-2"/>
        <xs:maxExclusive value="5"/>
    </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.

   

 

 

 

back to top