Stylus Studio XML Editor

Table of contents

Appendices

3.2 Primitive datatypes

Primitive datatypes

The primitive datatypes defined by this specification are described below. For each datatype, the value space and lexical space are defined, constraining facets which apply to the datatype are listed and any datatypes derived from this datatype are specified.

primitive datatypes can only be added by revisions to this specification.

string[top]

string

The string datatype represents character strings in XML. The value space of string is the set of finite-length sequences of characters (as defined in [XML]) that match the Char production from [XML]. A character is an atomic unit of communication; it is not further specified except to note that every character has a corresponding Universal Character Set code point, which is an integer.

NOTE: 

Many human languages have writing systems that require child elements for control of aspects such as bidirectional formating or ruby annotation (see [ruby] and Section 8.2.4 [Overriding the bidirectional algorithm: the BDO element] of [html4]). Thus, string, as a simple type that can contain only characters but not child elements, is often not suitable for representing text. In such situations, a complex type that allows mixed content should be considered. For more information, see Section 5.5 [Any Element, Any Attribute] of [schema-primer].

NOTE: 

As noted in [The ordered Schema Component], the fact that this specification does not specify an order-relation for string does not preclude other applications from treating strings as being ordered.

Constraining facets[top]

Constraining facets

Derived datatypes[top]

Derived datatypes

boolean[top]

boolean

boolean has the value space required to support the mathematical concept of binary-valued logic: {true, false}.

Lexical representation[top]

Lexical representation

An instance of a datatype that is defined as boolean can have the following legal literals {true, false, 1, 0}.

Canonical representation[top]

Canonical representation

The canonical representation for boolean is the set of literals {true, false}.

Constraining facets[top]

Constraining facets

decimal[top]

decimal

decimal represents arbitrary precision decimal numbers. The value space of decimal is the set of the values i × 10^-n, where i and n are integers such that n >= 0. The order-relation on decimal is: x < y iff y - x is positive.

The value space of types derived from decimal with a value for totalDigits of p is the set of values i × 10^-n, where n and i are integers such that p >= n >= 0 and the number of significant decimal digits in i is less than or equal to p.

The value space of types derived from decimal with a value for fractionDigits of s is the set of values i × 10^-n, where i and n are integers such that 0 <= n <= s.

NOTE: 

All minimally conforming processors must support decimal numbers with a minimum of 18 decimal digits (i.e., with a totalDigits of 18). However, minimally conforming processors may set an application-defined limit on the maximum number of decimal digits they are prepared to support, in which case that application-defined maximum number must be clearly documented.

Lexical representation[top]

Lexical representation

decimal has a lexical representation consisting of a finite-length sequence of decimal digits (#x30-#x39) separated by a period as a decimal indicator. If totalDigits is specified, the number of digits must be less than or equal to totalDigits. If fractionDigits is specified, the number of digits following the decimal point must be less than or equal to the fractionDigits. An optional leading sign is allowed. If the sign is omitted, "+" is assumed. Leading and trailing zeroes are optional. If the fractional part is zero, the period and following zero(es) can be omitted. For example: -1.23, 12678967.543233, +100000.00, 210.

Canonical representation[top]

Canonical representation

The canonical representation for decimal is defined by prohibiting certain options from the [Lexical representation]. Specifically, the preceding optional "+" sign is prohibited. The decimal point is required. Leading and trailing zeroes are prohibited subject to the following: there must be at least one digit to the right and to the left of the decimal point which may be a zero.

Constraining facets[top]

Constraining facets

Derived datatypes[top]

Derived datatypes

float[top]

float

float corresponds to the IEEE single-precision 32-bit floating point type [ieee754]. The basic value space of float consists of the values m × 2^e, where m is an integer whose absolute value is less than 2^24, and e is an integer between -149 and 104, inclusive. In addition to the basic value space described above, the value space of float also contains the following special values: positive and negative zero, positive and negative infinity and not-a-number. The order-relation on float is: x < y iff y - x is positive. Positive zero is greater than negative zero. Not-a-number equals itself and is greater than all float values including positive infinity.

A literal in the lexical space representing a decimal number d maps to the normalized value in the value space of float that is closest to d in the sense defined by [clinger1990]; if d is exactly halfway between two such values then the even value is chosen.

Lexical representation[top]

Lexical representation

float values have a lexical representation consisting of a mantissa followed, optionally, by the character "E" or "e", followed by an exponent. The exponent must be an [integer]. The mantissa must be a [decimal] number. The representations for exponent and mantissa must follow the lexical rules for [integer] and [decimal]. If the "E" or "e" and the following exponent are omitted, an exponent value of 0 is assumed.

The special values positive and negative zero, positive and negative infinity and not-a-number have lexical representations 0, -0, INF, -INF and NaN, respectively.

For example, -1E4, 1267.43233E12, 12.78e-2, 12 and INF are all legal literals for float.

Canonical representation[top]

Canonical representation

The canonical representation for float is defined by prohibiting certain options from the [Lexical representation]. Specifically, the exponent must be indicated by "E". Leading zeroes and the preceding optional "+" sign are prohibited in the exponent. For the mantissa, the preceding optional "+" sign is prohibited and the decimal point is required. For the exponent, the preceding optional "+" sign is prohibited. Leading and trailing zeroes are prohibited subject to the following: number representations must be normalized such that there is a single digit to the left of the decimal point and at least a single digit to the right of the decimal point.

Constraining facets[top]

Constraining facets

double[top]

double

The double datatype corresponds to IEEE double-precision 64-bit floating point type [ieee754]. The basic value space of double consists of the values m × 2^e, where m is an integer whose absolute value is less than 2^53, and e is an integer between -1075 and 970, inclusive. In addition to the basic value space described above, the value space of double also contains the following special values: positive and negative zero, positive and negative infinity and not-a-number. The order-relation on double is: x < y iff y - x is positive. Positive zero is greater than negative zero. Not-a-number equals itself and is greater than all double values including positive infinity.

A literal in the lexical space representing a decimal number d maps to the normalized value in the value space of double that is closest to d; if d is exactly halfway between two such values then the even value is chosen. This is the best approximation of d ([clinger1990], [gay1990]), which is more accurate than the mapping required by [ieee754].

Lexical representation[top]

Lexical representation

double values have a lexical representation consisting of a mantissa followed, optionally, by the character "E" or "e", followed by an exponent. The exponent must be an integer. The mantissa must be a decimal number. The representations for exponent and mantissa must follow the lexical rules for [integer] and [decimal]. If the "E" or "e" and the following exponent are omitted, an exponent value of 0 is assumed.

The special values positive and negative zero, positive and negative infinity and not-a-number have lexical representations 0, -0, INF, -INF and NaN, respectively.

For example, -1E4, 1267.43233E12, 12.78e-2, 12 and INF are all legal literals for double.

Canonical representation[top]

Canonical representation

The canonical representation for double is defined by prohibiting certain options from the [Lexical representation]. Specifically, the exponent must be indicated by "E". Leading zeroes and the preceding optional "+" sign are prohibited in the exponent. For the mantissa, the preceding optional "+" sign is prohibited and the decimal point is required. For the exponent, the preceding optional "+" sign is prohibited. Leading and trailing zeroes are prohibited subject to the following: number representations must be normalized such that there is a single digit to the left of the decimal point and at least a single digit to the right of the decimal point.

Constraining facets[top]

Constraining facets

duration[top]

duration

duration represents a duration of time. The value space of duration is a six-dimensional space where the coordinates designate the Gregorian year, month, day, hour, minute, and second components defined in § 5.5.3.2 of [ISO8601], respectively. These components are ordered in their significance by their order of appearance i.e. as year, month, day, hour, minute, and second.

Lexical representation[top]

Lexical representation

The lexical representation for duration is the [ISO8601] extended format PnYn MnDTnH nMnS, where nY represents the number of years, nM the number of months, nD the number of days, 'T' is the date/time separator, nH the number of hours, nM the number of minutes and nS the number of seconds. The number of seconds can include decimal digits to arbitrary precision.

The values of the Year, Month, Day, Hour and Minutes components are not restricted but allow an arbitrary integer. Similarly, the value of the Seconds component allows an arbitrary decimal. Thus, the lexical representation of duration does not follow the alternative format of § 5.5.3.2.1 of [ISO8601].

An optional preceding minus sign ('-') is allowed, to indicate a negative duration. If the sign is omitted a positive duration is indicated. See also [ISO 8601 Date and Time Formats].

For example, to indicate a duration of 1 year, 2 months, 3 days, 10 hours, and 30 minutes, one would write: P1Y2M3DT10H30M. One could also indicate a duration of minus 120 days as: -P120D.

Reduced precision and truncated representations of this format are allowed provided they conform to the following:

  • If the number of years, months, days, hours, minutes, or seconds in any expression equals zero, the number and its corresponding designator may be omitted. However, at least one number and its designator must be present.

  • The seconds part may have a decimal fraction.

  • The designator 'T' shall be absent if all of the time items are absent. The designator 'P' must always be present.

For example, P1347Y, P1347M and P1Y2MT2H are all allowed; P0Y1347M and P0Y1347M0D are allowed. P-1347M is not allowed although -P1347M is allowed. P1Y2MT is not allowed.

Order relation on duration[top]

Order relation on duration

In general, the order-relation on duration is a partial order since there is no determinate relationship between certain durations such as one month (P1M) and 30 days (P30D). The order-relation of two duration values x and y is x < y iff s+x < s+y for each qualified [dateTime] s in the list below. These values for s cause the greatest deviations in the addition of dateTimes and durations. Addition of durations to time instants is defined in [Adding durations to dateTimes].

  • 1696-09-01T00:00:00Z

  • 1697-02-01T00:00:00Z

  • 1903-03-01T00:00:00Z

  • 1903-07-01T00:00:00Z

The following table shows the strongest relationship that can be determined between example durations. The symbol <> means that the order relation is indeterminate. Note that because of leap-seconds, a seconds field can vary from 59 to 60. However, because of the way that addition is defined in [Adding durations to dateTimes], they are still totally ordered.

104   Relation
background-color:#FFFF9911P1Y 11> P364D 11<> P365D 31  11<> P366D 11< P367D
background-color:#FFFF9911P1M 11> P27D 11<> P28D 21<> P29D 11<> P30D 11<> P31D 11< P32D
background-color:#FFFF9911P5M 11> P149D 11<> P150D 11<> P151D 21<> P152D 11<> P153D 11< P154D

Implementations are free to optimize the computation of the ordering relationship. For example, the following table can be used to compare durations of a small number of months against days.

102   Months 1 2 3 4 5 6 7 8 9 10 11 12 13 ... Days Minimum Maximum
center1128 center1159 center1189 center11120 center11150 center11181 center11212 center11242 center11273 center11303 center11334 center11365 center11393 center11...
center1131 center1162 center1192 center11123 center11153 center11184 center11215 center11245 center11276 center11306 center11337 center11366 center11397 center11...

Facet Comparison for durations[top]

Facet Comparison for durations

In comparing duration values with [The minInclusive Schema Component], [The minExclusive Schema Component], [The maxInclusive Schema Component] and [The maxExclusive Schema Component] facet values indeterminate comparisons should be considered as "false".

Totally ordered durations[top]

Totally ordered durations

Certain derived datatypes of durations can be guaranteed have a total order. For this, they must have fields from only one row in the list below and the time zone must either be required or prohibited.

  • year, month

  • day, hour, minute, second

For example, a datatype could be defined to correspond to the [SQL] datatype Year-Month interval that required a four digit year field and a two digit month field but required all other fields to be unspecified. This datatype could be defined as below and would have a total order.

<simpleType name='SQL-Year-Month-Interval'>
    <restriction base='duration'>
      <pattern value='P\p{Nd}{4}Y\p{Nd}{2}M'/>
    </restriction>
</simpleType>

Constraining facets[top]

Constraining facets

dateTime[top]

dateTime

dateTime represents a specific instant of time. The value space of dateTime is the space of Combinations of date and time of day values as defined in § 5.4 of [ISO8601].

Lexical representation[top]

Lexical representation

A single lexical representation, which is a subset of the lexical representations allowed by [ISO8601], is allowed for dateTime. This lexical representation is the [ISO8601] extended format CCYY-MM-DDThh:mm:ss where "CC" represents the century, "YY" the year, "MM" the month and "DD" the day, preceded by an optional leading "-" sign to indicate a negative number. If the sign is omitted, "+" is assumed. The letter "T" is the date/time separator and "hh", "mm", "ss" represent hour, minute and second respectively. Additional digits can be used to increase the precision of fractional seconds if desired i.e the format ss.ss... with any number of digits after the decimal point is supported. The fractional seconds part is optional; other parts of the lexical form are not optional. To accommodate year values greater than 9999 additional digits can be added to the left of this representation. Leading zeros are required if the year value would otherwise have fewer than four digits; otherwise they are forbidden. The year 0000 is prohibited.

The CCYY field must have at least four digits, the MM, DD, SS, hh, mm and ss fields exactly two digits each (not counting fractional seconds); leading zeroes must be used if the field would otherwise have too few digits.

This representation may be immediately followed by a "Z" to indicate Coordinated Universal Time (UTC) or, to indicate the time zone, i.e. the difference between the local time and Coordinated Universal Time, immediately followed by a sign, + or -, followed by the difference from UTC represented as hh:mm (note: the minutes part is required). See [ISO 8601 Date and Time Formats] for details about legal values in the various fields. If the time zone is included, both hours and minutes must be present.

For example, to indicate 1:20 pm on May the 31st, 1999 for Eastern Standard Time which is 5 hours behind Coordinated Universal Time (UTC), one would write: 1999-05-31T13:20:00-05:00.

Canonical representation[top]

Canonical representation

The canonical representation for dateTime is defined by prohibiting certain options from the [Lexical representation]. Specifically, either the time zone must be omitted or, if present, the time zone must be Coordinated Universal Time (UTC) indicated by a "Z".

Order relation on dateTime[top]

Order relation on dateTime

In general, the order-relation on dateTime is a partial order since there is no determinate relationship between certain instants. For example, there is no determinate ordering between (a) 2000-01-20T12:00:00 and (b) 2000-01-20T12:00:00Z. Based on timezones currently in use, (c) could vary from 2000-01-20T12:00:00+12:00 to 2000-01-20T12:00:00-13:00. It is, however, possible for this range to expand or contract in the future, based on local laws. Because of this, the following definition uses a somewhat broader range of indeterminate values: +14:00..-14:00.

The following definition uses the notation S[year] to represent the year field of S, S[month] to represent the month field, and so on. The notation (Q & "-14:00") means adding the timezone -14:00 to Q, where Q did not already have a timezone. This is a logical explanation of the process. Actual implementations are free to optimize as long as they produce the same results.

The ordering between two dateTimes P and Q is defined by the following algorithm:

A.Normalize P and Q. That is, if there is a timezone present, but it is not Z, convert it to Z using the addition operation defined in [Adding durations to dateTimes]

  • Thus 2000-03-04T23:00:00+03:00 normalizes to 2000-03-04T20:00:00Z

B. If P and Q either both have a time zone or both do not have a time zone, compare P and Q field by field from the year field down to the second field, and return a result as soon as it can be determined. That is:

  1. For each i in {year, month, day, hour, minute, second}

    1. If P[i] and Q[i] are both not specified, continue to the next i

    2. If P[i] is not specified and Q[i] is, or vice versa, stop and return P <> Q

    3. If P[i] < Q[i], stop and return P < Q

    4. If P[i] > Q[i], stop and return P > Q

  2. Stop and return P = Q

C.Otherwise, if P contains a time zone and Q does not, compare as follows:

  1. P < Q if P < (Q with time zone +14:00)

  2. P > Q if P > (Q with time zone -14:00)

  3. P <> Q otherwise, that is, if (Q with time zone +14:00) < P < (Q with time zone -14:00)

D. Otherwise, if P does not contain a time zone and Q does, compare as follows:

  1. P < Q if (P with time zone -14:00) < Q.

  2. P > Q if (P with time zone +14:00) > Q.

  3. P <> Q otherwise, that is, if (P with time zone +14:00) < Q < (P with time zone -14:00)

Examples:

104 Determinate Indeterminate
center112000-01-15T00:00:00 < 2000-02-15T00:00:00 center112000-01-01T12:00:00 <> 1999-12-31T23:00:00Z
center112000-01-15T12:00:00 < 2000-01-16T12:00:00Z center112000-01-16T12:00:00 <> 2000-01-16T12:00:00Z
center11  center112000-01-16T00:00:00 <> 2000-01-16T12:00:00Z

Totally ordered dateTimes[top]

Totally ordered dateTimes

Certain derived types from dateTime can be guaranteed have a total order. To do so, they must require that a specific set of fields are always specified, and that remaining fields (if any) are always unspecified. For example, the date datatype without time zone is defined to contain exactly year, month, and day. Thus dates without time zone have a total order among themselves.

Constraining facets[top]

Constraining facets

time[top]

time

time represents an instant of time that recurs every day. The value space of time is the space of time of day values as defined in § 5.3 of [ISO8601]. Specifically, it is a set of zero-duration daily time instances.

Since the lexical representation allows an optional time zone indicator, time values are partially ordered because it may not be able to determine the order of two values one of which has a time zone and the other does not. The order relation on time values is the [Order relation on dateTime] using an arbitrary date. See also [Adding durations to dateTimes]. Pairs of time values with or without time zone indicators are totally ordered.

Lexical representation[top]

Lexical representation

The lexical representation for time is the left truncated lexical representation for [dateTime]: hh:mm:ss.sss with optional following time zone indicator. For example, to indicate 1:20 pm for Eastern Standard Time which is 5 hours behind Coordinated Universal Time (UTC), one would write: 13:20:00-05:00. See also [ISO 8601 Date and Time Formats].

Canonical representation[top]

Canonical representation

The canonical representation for time is defined by prohibiting certain options from the [Lexical representation]. Specifically, either the time zone must be omitted or, if present, the time zone must be Coordinated Universal Time (UTC) indicated by a "Z". Additionally, the canonical representation for midnight is 00:00:00.

Constraining facets[top]

Constraining facets

date[top]

date

date represents a calendar date. The value space of date is the set of Gregorian calendar dates as defined in § 5.2.1 of [ISO8601]. Specifically, it is a set of one-day long, non-periodic instances e.g. lexical 1999-10-26 to represent the calendar date 1999-10-26, independent of how many hours this day has.

Since the lexical representation allows an optional time zone indicator, date values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If date values are considered as periods of time, the order relation on date values is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of date values with or without time zone indicators are totally ordered.

Lexical representation[top]

Lexical representation

The lexical representation for date is the reduced (right truncated) lexical representation for [dateTime]: CCYY-MM-DD. No left truncation is allowed. An optional following time zone qualifier is allowed as for [dateTime]. To accommodate year values outside the range from 0001 to 9999, additional digits can be added to the left of this representation and a preceding "-" sign is allowed.

For example, to indicate May the 31st, 1999, one would write: 1999-05-31. See also [ISO 8601 Date and Time Formats].

Constraining facets[top]

Constraining facets

gYearMonth[top]

gYearMonth

gYearMonth represents a specific gregorian month in a specific gregorian year. The value space of gYearMonth is the set of Gregorian calendar months as defined in § 5.2.1 of [ISO8601]. Specifically, it is a set of one-month long, non-periodic instances e.g. 1999-10 to represent the whole month of 1999-10, independent of how many days this month has.

Since the lexical representation allows an optional time zone indicator, gYearMonth values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If gYearMonth values are considered as periods of time, the order relation on gYearMonth values is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of gYearMonth values with or without time zone indicators are totally ordered.

NOTE: 

Because month/year combinations in one calendar only rarely correspond to month/year combinations in other calendars, values of this type are not, in general, convertible to simple values corresponding to month/year combinations in other calendars. This type should therefore be used with caution in contexts where conversion to other calendars is desired.

Lexical representation[top]

Lexical representation

The lexical representation for gYearMonth is the reduced (right truncated) lexical representation for [dateTime]: CCYY-MM. No left truncation is allowed. An optional following time zone qualifier is allowed. To accommodate year values outside the range from 0001 to 9999, additional digits can be added to the left of this representation and a preceding "-" sign is allowed.

For example, to indicate the month of May 1999, one would write: 1999-05. See also [ISO 8601 Date and Time Formats].

Constraining facets[top]

Constraining facets

gYear[top]

gYear

gYear represents a gregorian calendar year. The value space of gYear is the set of Gregorian calendar years as defined in § 5.2.1 of [ISO8601]. Specifically, it is a set of one-year long, non-periodic instances e.g. lexical 1999 to represent the whole year 1999, independent of how many months and days this year has.

Since the lexical representation allows an optional time zone indicator, gYear values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If gYear values are considered as periods of time, the order relation on gYear values is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of gYear values with or without time zone indicators are totally ordered.

NOTE: 

Because years in one calendar only rarely correspond to years in other calendars, values of this type are not, in general, convertible to simple values corresponding to years in other calendars. This type should therefore be used with caution in contexts where conversion to other calendars is desired.

Lexical representation[top]

Lexical representation

The lexical representation for gYear is the reduced (right truncated) lexical representation for [dateTime]: CCYY. No left truncation is allowed. An optional following time zone qualifier is allowed as for [dateTime]. To accommodate year values outside the range from 0001 to 9999, additional digits can be added to the left of this representation and a preceding "-" sign is allowed.

For example, to indicate 1999, one would write: 1999. See also [ISO 8601 Date and Time Formats].

Constraining facets[top]

Constraining facets

gMonthDay[top]

gMonthDay

gMonthDay is a gregorian date that recurs, specifically a day of the year such as the third of May. Arbitrary recurring dates are not supported by this datatype. The value space of gMonthDay is the set of calendar dates, as defined in § 3 of [ISO8601]. Specifically, it is a set of one-day long, annually periodic instances.

Since the lexical representation allows an optional time zone indicator, gMonthDay values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If gMonthDay values are considered as periods of time, the order relation on gMonthDay values is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of gMonthDay values with or without time zone indicators are totally ordered.

NOTE: 

Because day/month combinations in one calendar only rarely correspond to day/month combinations in other calendars, values of this type do not, in general, have any straightforward or intuitive representation in terms of most other calendars. This type should therefore be used with caution in contexts where conversion to other calendars is desired.

Lexical representation[top]

Lexical representation

The lexical representation for gMonthDay is the left truncated lexical representation for [date]: --MM-DD. An optional following time zone qualifier is allowed as for [date]. No preceding sign is allowed. No other formats are allowed. See also [ISO 8601 Date and Time Formats].

This datatype can be used to represent a specific day in a month. To say, for example, that my birthday occurs on the 14th of September ever year.

Constraining facets[top]

Constraining facets

gDay[top]

gDay

gDay is a gregorian day that recurs, specifically a day of the month such as the 5th of the month. Arbitrary recurring days are not supported by this datatype. The value space of gDay is the space of a set of calendar dates as defined in § 3 of [ISO8601]. Specifically, it is a set of one-day long, monthly periodic instances.

This datatype can be used to represent a specific day of the month. To say, for example, that I get my paycheck on the 15th of each month.

Since the lexical representation allows an optional time zone indicator, gDay values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If gDay values are considered as periods of time, the order relation on gDay values is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of gDay values with or without time zone indicators are totally ordered.

NOTE: 

Because days in one calendar only rarely correspond to days in other calendars, values of this type do not, in general, have any straightforward or intuitive representation in terms of most other calendars. This type should therefore be used with caution in contexts where conversion to other calendars is desired.

Lexical representation[top]

Lexical representation

The lexical representation for gDay is the left truncated lexical representation for [date]: ---DD . An optional following time zone qualifier is allowed as for [date]. No preceding sign is allowed. No other formats are allowed. See also [ISO 8601 Date and Time Formats].

Constraining facets[top]

Constraining facets

gMonth[top]

gMonth

gMonth is a gregorian month that recurs every year. The value space of gMonth is the space of a set of calendar months as defined in § 3 of [ISO8601]. Specifically, it is a set of one-month long, yearly periodic instances.

This datatype can be used to represent a specific month. To say, for example, that Thanksgiving falls in the month of November.

Since the lexical representation allows an optional time zone indicator, gMonth values are partially ordered because it may not be possible to unequivocally determine the order of two values one of which has a time zone and the other does not. If gMonth values are considered as periods of time, the order relation on gMonth is the order relation on their starting instants. This is discussed in [Order relation on dateTime]. See also [Adding durations to dateTimes]. Pairs of gMonth values with or without time zone indicators are totally ordered.

NOTE: 

Because months in one calendar only rarely correspond to months in other calendars, values of this type do not, in general, have any straightforward or intuitive representation in terms of most other calendars. This type should therefore be used with caution in contexts where conversion to other calendars is desired.

Lexical representation[top]

Lexical representation

The lexical representation for gMonth is the left and right truncated lexical representation for [date]: --MM--. An optional following time zone qualifier is allowed as for [date]. No preceding sign is allowed. No other formats are allowed. See also [ISO 8601 Date and Time Formats].

Constraining facets[top]

Constraining facets

hexBinary[top]

hexBinary

hexBinary represents arbitrary hex-encoded binary data. The value space of hexBinary is the set of finite-length sequences of binary octets.

Lexical Representation[top]

Lexical Representation

hexBinary has a lexical representation where each binary octet is encoded as a character tuple, consisting of two hexadecimal digits ([0-9a-fA-F]) representing the octet code. For example, "0FB7" is a hex encoding for the 16-bit integer 4023 (whose binary representation is 111110110111).

Canonical Rrepresentation[top]

Canonical Rrepresentation

The canonical representation for hexBinary is defined by prohibiting certain options from the [Lexical Representation]. Specifically, the lower case hexadecimal digits ([a-f]) are not allowed.

Constraining facets[top]

Constraining facets

base64Binary[top]

base64Binary

base64Binary represents Base64-encoded arbitrary binary data. The value space of base64Binary is the set of finite-length sequences of binary octets. For base64Binary data the entire binary stream is encoded using the Base64 Content-Transfer-Encoding defined in Section 6.8 of [RFC2045].

Constraining facets[top]

Constraining facets

anyURI[top]

anyURI

anyURI represents a Uniform Resource Identifier Reference (URI). An anyURI value can be absolute or relative, and may have an optional fragment identifier (i.e., it may be a URI Reference). This type should be used to specify the intention that the value fulfills the role of a URI as defined by [RFC2396], as amended by [RFC2732].

The mapping from anyURI values to URIs is as defined in Section 5.4 [Locator Attribute] of [XLink] (see also Section 8 [Character Encoding in URI References] of [CharMod]). This means that a wide range of internationalized resource identifiers can be specified when an anyURI is called for, and still be understood as URIs per [RFC2396], as amended by [RFC2732], where appropriate to identify resources.

NOTE: 

Each URI scheme imposes specialized syntax rules for URIs in that scheme, including restrictions on the syntax of allowed fragement identifiers. Because it is impractical for processors to check that a value is a context-appropriate URI reference, this specification follows the lead of [RFC2396] (as amended by [RFC2732]) in this matter: such rules and restrictions are not part of type validity and are not checked by minimally conforming processors. Thus in practice the above definition imposes only very modest obligations on minimally conforming processors.

Lexical representation[top]

Lexical representation

The lexical space of anyURI is finite-length character sequences which, when the algorithm defined in Section 5.4 of [XLink] is applied to them, result in strings which are legal URIs according to [RFC2396], as amended by [RFC2732].

NOTE: 

Spaces are, in principle, allowed in the lexical space of anyURI, however, their use is highly discouraged (unless they are encoded by %20).

Constraining facets[top]

Constraining facets

QName[top]

QName

QName represents [XML qualified names]. The value space of QName is the set of tuples {[namespace name], [local part]}, where [namespace name] is an [anyURI] and [local part] is an [NCName]. The lexical space of QName is the set of strings that match the [ QName] production of [XMLNS].

NOTE: 

The mapping between literals in the lexical space and values in the value space of QName requires a namespace declaration to be in scope for the context in which QName is used.

Constraining facets[top]

Constraining facets

NOTATION[top]

NOTATION

NOTATION represents the NOTATION attribute type from [XML]. The value space of NOTATION is the set [QName]s. The lexical space of NOTATION is the set of all names of [notations] declared in the current schema.

enumeration facet value required for NOTATION

It is an error for NOTATION to be used directly in a schema. Only datatypes that are derived from NOTATION by specifying a value for enumeration can be used in a schema.

For compatibility (see [Terminology]) NOTATION should be used only on attributes.

Constraining facets[top]

Constraining facets