Determines the minimum and maximum allowed values
Applies to ordered simple types including
byte
, unsignedByte
,
integer
, positiveInteger
,
negativeInteger
, nonNegativeInteger
,
nonPositiveInteger
, int
,
unsignedInt
, long
,
number
, unsignedLong
,
short
, unsignedShort
, number
,
float
, double
, time
,
dateTime
,
duration
, date
, gMonth
,
gYear
, gDay
,
and gMonthDay
.
For example, to say that the year must be between 1877 and 2100:
<?xml version="1.0"?>
<element name="SONG" xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<element name="TITLE">
<text/>
</element>
<oneOrMore>
<element name="COMPOSER">
<data type="string"/>
</element>
</oneOrMore>
<zeroOrMore>
<element name="PRODUCER">
<data type="string"/>
</element>
</zeroOrMore>
<optional>
<element name="PUBLISHER">
<data type="string"/>
</element>
</optional>
<optional>
<element name="LENGTH">
<data type="string"/>
</element>
</optional>
<optional>
<element name="YEAR">
<data type="gYear">
<param name="minInclusive">1877</param>
<param name="maxInclusive">2100</param>
</data>
</element>
</optional>
<oneOrMore>
<element name="ARTIST">
<data type="string"/>
</element>
</oneOrMore>
</element>
In the compact syntax:
element SONG {
element TITLE { text },
element COMPOSER { xsd:string }+,
element PRODUCER { xsd:string }*,
element PUBLISHER { xsd:string }?,
element LENGTH { xsd:string }?,
element YEAR {
xsd:gYear { minInclusive = "1877"
maxInclusive = "2100"
}
}?,
element ARTIST { xsd:string }+
}