-- TTCN3 module extracted from ITU-T Z.167 (05/2012)
module ISO8601DateTimePatterns {
//=========================================================================
// Imports
//=========================================================================
import from nc all;
//=========================================================================
// Templates
//=========================================================================
//============================DATE FORMS==================================
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.2
//*
//* @desc Matches all calendar date representations (complete, reduced
//* accuracy and expanded) in basic formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateCalendarBasic := pattern
"{nc.yearExpansionOpt}({nc.century}|{nc.year}({nc.month}{nc.dayOfMonth}|" &
"{dash}{nc.month})#(,1))";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.2
//*
//* @desc Matches all calendar date representations (complete and expanded)
//* in extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateCalendarExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}{nc.month}{dash}{nc.dayOfMonth}";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.2
//*
//* @desc Matches all calendar date representations (complete, reduced
//* accuracy and expanded) in basic and extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateCalendar := (
t_ISO8601DateCalendarBasic,
t_ISO8601DateCalendarExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.3
//*
//* @desc Matches all ordinal date representations (complete, reduced
//* accuracy and expanded) in basic formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateOrdinalBasic := pattern
"{nc.yearExpansionOpt}{nc.year}{nc.dayOfYear}";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.3
//*
//* @desc Matches all ordinal date representations (complete, reduced
//* accuracy and expanded) in basic formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateOrdinalExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}{nc.dayOfYear}";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.3
//*
//* @desc Matches all ordinal date representations (complete, reduced
//* accuracy and expanded) in basic and extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateOrdinal := (
t_ISO8601DateOrdinalBasic,
t_ISO8601DateOrdinalExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.4
//*
//* @desc Matches all week date representations (complete, reduced
//* accuracy and expanded) in basic formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateWeekBasic := pattern
"{nc.yearExpansionOpt}{nc.year}{nc.week}{nc.dayOfWeek}#(,1)";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.4
//*
//* @desc Matches all week date representations (complete, reduced
//* accuracy and expanded) in extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateWeekExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}{nc.week}({dash}{nc.dayOfWeek})#(,1)";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1.4
//*
//* @desc Matches all week date representations (complete, reduced
//* accuracy and expanded) in basic and extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateWeek := (
t_ISO8601DateWeekBasic,
t_ISO8601DateWeekExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1
//*
//* @desc Matches all date representations (complete, reduced accuracy
//* and expanded) in basic formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateBasic := (
t_ISO8601DateCalendarBasic,
t_ISO8601DateOrdinalBasic,
t_ISO8601DateWeekBasic
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.1
//*
//* @desc Matches all date representations (complete, reduced accuracy
//* and expanded) in extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateExtended := (
t_ISO8601DateCalendarExtended,
t_ISO8601DateOrdinalExtended,
t_ISO8601DateWeekExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601
//*
//* @desc Matches all date representations (complete, reduced accuracy and
//* expanded) in basic and extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601Date := (
t_ISO8601DateBasic,
t_ISO8601DateExtended
)
//============================TIME-OF-DAY============================
//*****************************************************************************
//*
//* @reference ISO_8601 $4.2
//*
//* @desc Matches all time of day representations in basic formats
//* Supports all time of day representations as local time: complete
//* ($4.2.2.2), reduced accuracy($4.2.2.3) and with decimal fraction
//* ($4.2.2.4), midnight($4.2.3); UTC of day ($4.2.4) and difference
//* between local time and UTC of day ($4.2.5)and the optional time
//* designator
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601TimeBasic := pattern
"{nc.optionalT}({nc.hour}({nc.minute}({nc.second}{nc.sFraction}#(,1)|60|" &
"{nc.mFraction})#(,1)|60|{nc.hFraction})#(,1)|{nc.endOfDay})" &
"{nc.optZorTimeZone}";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.2
//*
//* @desc Matches all time of day representations in extended formats
//* Supports all time of day representations as local time: complete
//* ($4.2.2.2), reduced accuracy($4.2.2.3) and with decimal fraction
//* ($4.2.2.4), midnight($4.2.3); UTC of day ($4.2.4) and difference between
//* local time and UTC of day ($4.2.5)and the optional time designator
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601TimeExtended := pattern
"{nc.optionalT}({nc.hour}{colon}({nc.minute}({colon}({nc.second}" &
"{nc.sFraction}#(,1)|60)|{nc.mFraction})#(,1)|60)|{nc.endOfDayExt})" &
"{nc.optZorTimeZoneExt}";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.2
//*
//* @desc Matches all time of day representations in basic and extended formats
//* Supports all time of day representations as local time: complete
//* ($4.2.2.2), reduced accuracy($4.2.2.3) and with decimal fraction
//* ($4.2.2.4), midnight($4.2.3); UTC of day ($4.2.4) and difference between
//* local time and UTC of day ($4.2.5)and the optional time designator
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601Time := (
t_ISO8601TimeBasic,
t_ISO8601TimeExtended
)
//============================DATE-TIME FORMATS================================
//*****************************************************************************
//*
//* @reference ISO_8601 $4.3
//*
//* @desc Matches all date/time of day representations in basic formats
//*
//* @remark Acc. to $4.3... ?) the date part shall always be complete
//* @remark Omitting the T designer between the date and time parts is not
//* supported
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateTimeBasic := pattern
"{nc.yearExpansionOpt}{nc.year}({nc.month}{nc.dayOfMonth}|{nc.dayOfYear}|" &
"{nc.week}{nc.dayOfWeek})T({nc.hour}({nc.minute}({nc.second}" &
"{nc.sFraction}#(,1)|60|{nc.mFraction})#(,1)|60|{nc.hFraction})#(,1)" &
"{nc.optZorTimeZone}|{nc.endOfDay}{nc.optZorTimeZone})";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.3
//*
//* @desc Matches all date/time of day representations in all formats
//*
//* @remark Acc. to $4.3.3 c) the date part shall always be complete
//* @remark Omitting the T designer between the date and time parts is not
//* supported
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateTimeExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}({nc.month}{dash}{nc.dayOfMonth}|" &
"{nc.dayOfYear}|{nc.week}{dash}{nc.dayOfWeek})T({nc.hour}{colon}" &
"({nc.minute}({colon}({nc.second}{nc.sFraction}#(,1)|60)|{nc.mFraction})" &
"#(,1)|60){nc.optZorTimeZoneExt}|{nc.endOfDayExt}{nc.optZorTimeZoneExt})";
//*****************************************************************************
//*
//* @reference ISO_8601 $4.3
//*
//* @desc Matches all date/time of day representations in all formats
//*
//* @remark Acc. to $4.3... ?) the date part shall always be complete
//* @remark Omitting the T designer between the date and time parts is not
//* supported
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DateTime := (
t_ISO8601DateTimeBasic,
t_ISO8601DateTimeExtended
)
//============================DURATION============================
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.2
//*
//* @desc Matches duration representations containing only date components
//* and using the format with designators; Both week and caledar dates
//* are supported (the alternative format in $4.4.3.3 is excluded: it is
//* covered by t_ISO8601DurationAlternative...)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationDesignDate := pattern
"P{nc.nums}(Y({nc.nums}(M({nc.nums}(D|{nc.dFraction}D))#(,1)|" &
"{nc.dFraction}[MD]|D))#(,1)|{nc.dFraction}[YMDW]|M({nc.nums}" &
"(D|{nc.dFraction}D)|{nc.dFraction}D)#(,1)|D|W)"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.2
//*
//* @desc Matches duration representations containing time components
//* only and using the format with designators
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationDesignTime := pattern
"PT{nc.nums}(H({nc.nums}(M({nc.nums}(S|{nc.dFraction}S))#(,1)|" &
"{nc.dFraction}[MS]|S))#(,1)|{nc.dFraction}[HMS]|M({nc.nums}(S|" &
"{nc.dFraction}S)|{nc.dFraction}M)#(,1)|S)"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.2
//*
//* @desc Matches duration representations using the format with designators;
//* Both week and caledar dates are supported (the alternative format in
//* $4.4.3.3 is excluded: it is covered by t_ISO8601DurationAlternative...)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationDesign := pattern
"P({nc.nums}((Y({nc.nums}(M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|" &
"{nc.durTime}#(,1))|{nc.dFraction}[MD]|D{nc.durTime}#(,1))|{nc.durTime}" &
"#(,1))|{nc.dFraction}[YMDW])|M({nc.nums}(D{nc.durTime}#(,1)|" &
"{nc.dFraction}D)|{nc.dFraction}D|{nc.durTime}#(,1))|D{nc.durTime}#(,1)|" &
"W{nc.durTime}#(,1))|{nc.durTime})"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.3
//*
//* @desc Matches duration representations using the alternative basic format
//*
//* @remark Both caledar and ordinal dates are supported
//* @remark Any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P00011200T000000, P00010130T000000,
//* P001365T000000, P0001001T006000 and
//* P0001-001T00:00:60
//* are NOT accepted, only
//* P00020000T000000, P00010200T000000,
//* P002000T000000, P0001001T010000 and
//* P0001001T000100
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationAlternativeBasic := pattern
"P{nc.year}({nc.monthDurAlt}{nc.dayOfMonthDurAlt}|{nc.dayOfYearDurAlt})" &
"T{nc.hour}({nc.minute}({nc.second}{nc.sFraction}#(,1)|{nc.mFraction})" &
"#(,1)|{nc.hFraction})#(,1)"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.3
//*
//* @desc Matches duration representations using the alternative extended format
//*
//* @remark Both caledar and ordinal dates are supported
//* @remark Any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P0001-12-00T00:00:00, P0001-01-30T00:00:00,
//* P001-365T00:00:00, P0001-001T00:60:00 and
//* P0001-001T00:00:60
//* are NOT accepted, only
//* P0002-00-00T00:00:00, P0001-02-00T00:00:00,
//* P002-000T00:00:00, P0001-001T01:00:00 and
//* P0001-001T00:01:00
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationAlternativeExtended := pattern
"P{nc.year}{dash}({nc.monthDurAlt}{dash}{nc.dayOfMonthDurAlt}|" &
"{nc.dayOfYearDurAlt})T{nc.hour}{colon}{nc.minute}({colon}{nc.second}" &
"{nc.sFraction}#(,1)|{nc.mFraction})#(,1)"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3.3
//*
//* @desc Matches duration representations using the alternative format;
//* both the basic and the extended formats are supported
//*
//* @remark Both caledar and ordinal dates are supported
//* @remark Any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P0001-12-00T00:00:00, P0001-01-30T00:00:00,
//* P001-365T00:00:00, P0001-001T00:60:00 and
//* P0001-001T00:00:60
//* are NOT accepted, only
//* P0002-00-00T00:00:00, P0001-02-00T00:00:00,
//* P002-000T00:00:00, P0001-001T01:00:00 and
//* P0001-001T00:01:00
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationAlternative := (
t_ISO8601DurationAlternativeBasic,
t_ISO8601DurationAlternativeExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches duration representations using the both formats: with
//* designators and the alternative representation; in the alternative
//* representation only the basic format is allowed
//*
//* @remark both caledar and ordinal dates are supported
//* @remark any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P00011200T000000, P00010130T000000,
//* P001365T000000, P0001001T006000 and
//* P0001001T000060
//* are NOT accepted, only
//* P00020000T000000, P00010200T000000,
//* P002000T000000, P0001001T010000 and
//* P0001001T000100
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationBasic := pattern
"P({nc.year}({nc.monthDurAlt}{nc.dayOfMonthDurAlt}|{nc.dayOfYearDurAlt})" &
"T{nc.hour}(({nc.minute}({nc.second}{nc.sFraction}#(,1)|{nc.mFraction})" &
"#(,1)|{nc.hFraction})#(,1))|({nc.nums}((Y({nc.nums}(M({nc.nums}" &
"(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.durTime}#(,1))|{nc.dFraction}" &
"[MD]|D{nc.durTime}#(,1))|{nc.durTime}#(,1))|{nc.dFraction}[YMDW])|" &
"M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.dFraction}D|" &
"{nc.durTime}#(,1))|D{nc.durTime}#(,1)|W{nc.durTime}#(,1))|{nc.durTime}))"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches duration representations using the both formats: with designators
//* and the alternative representation; in the alternative representation only
//* the extended format is allowed
//*
//* @remark both caledar and ordinal dates are supported
//* @remark any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P0001-12-00T00:00:00, P0001-01-30T00:00:00,
//* P001-365T00:00:00, P0001-001T00:60:00 and
//* P0001-001T00:00:60
//* are NOT accepted, only
//* P0002-00-00T00:00:00, P0001-02-00T00:00:00,
//* P002-000T00:00:00, P0001-001T01:00:00 and
//* P0001-001T00:01:00
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601DurationExtended := pattern
"P({nc.year}{dash}({nc.monthDurAlt}{dash}{nc.dayOfMonthDurAlt}|" &
"{nc.dayOfYearDurAlt})T{nc.hour}{colon}{nc.minute}({colon}{nc.second}" &
"{nc.sFraction}#(,1)|{nc.mFraction})#(,1)|({nc.nums}((Y({nc.nums}" &
"(M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.durTime}#(,1))|" &
"{nc.dFraction}[MD]|D{nc.durTime}#(,1))|{nc.durTime}#(,1))|{nc.dFraction}" &
"[YMDW])|M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.dFraction}D|" &
"{nc.durTime}#(,1))|D{nc.durTime}#(,1)|W{nc.durTime}#(,1))|{nc.durTime}))"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches duration representations using both formats: with designators
//* and the alternative representation; in the alternative representation both
//* the basic and the extended formats are allowed
//*
//* @remark both caledar and ordinal dates are supported
//* @remark any of the components may be numerically 0;
//* @remark Carry over points are 12 month, 30 days, (365 days in case of
//* ordinal dates), 24 hours, 60 minutes and
//* 60 seconds; e.g.,
//* P0001-12-00T00:00:00, P0001-01-30T00:00:00,
//* P001-365T00:00:00, P0001-001T00:60:00 and
//* P0001-001T00:00:60
//* are NOT accepted, only
//* P0002-00-00T00:00:00, P0001-02-00T00:00:00,
//* P002-000T00:00:00, P0001-001T01:00:00 and
//* P0001-001T00:01:00
//* are valid
//* @remark The time part may be of reduced accuracy (by using decimal fraction
//* or omitting lower order time element(s)), the date part shall be
//* complete (i.e., numerically 0 elements shall not be omitted)
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601Duration := (
t_ISO8601DurationBasic,
t_ISO8601DurationExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy (see note below)time
//* interval representations identified by start and end and using the
//* basic format
//*
//* @remark $ 4.4.4.5 is contradictory as allows omitting higher order time
//* elements in the part representing end date/time (the expression
//* after the solidus), while the time part may also be of reduced
//* accuracy (either by omitting the lower order elements or by a
//* decimal fraction). This pattern resolves this conflict the
//* following way: Higher order elements can be omitted in the date
//* part of the expression following the solidus (in case of omitting
//* the weeks also the "W" is omitted!) but not in the time part. The
//* time part may be of reduced accuracy.
//* @remark There is no requirement in ISO8601 to keep reduced accuracy
//* compatible in the start and the end date/time; this may result
//* "strange" or in some cases unclear (in these cases agreement is
//* required between the communicating sides) time interval
//* representations, however these are allowed by this template
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartEndBasic := pattern
"{nc.yearExpansionOpt}{nc.year}({nc.month}{nc.dayOfMonth}|{nc.dayOfYear}|" &
"{nc.week}{nc.dayOfWeek})T({nc.hour}({nc.minute}({nc.second}{nc.sFraction}" &
"#(,1)|60|{nc.mFraction})#(,1)|60|{nc.hFraction})#(,1){nc.optZorTimeZone}|" &
"{nc.endOfDay}{nc.optZorTimeZone})/({nc.yearExpansionOpt}{nc.year}" &
"({nc.month}{nc.dayOfMonth}|{nc.dayOfYear}|{nc.week}{nc.dayOfWeek})|" &
"({nc.month}#(,1){nc.dayOfMonth}|{nc.dayOfYear}|{nc.week}#(,1){nc.dayOfWeek}))"&
"T({nc.hour}({nc.minute}({nc.second}{nc.sFraction}#(,1)|60|{nc.mFraction})" &
"#(,1)|60|{nc.hFraction})#(,1){nc.optZorTimeZone}|{nc.endOfDay}" &
"{nc.optZorTimeZone})"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy (see note below)time interval
//* representations identified by start and end and using the extended format
//*
//* @remark $ 4.4.4.5 is contradictory as allows omitting higher order time
//* elements in the part representing end date/time (the expression
//* after the solidus), while the time part may also be of reduced
//* accuracy (either by omitting the lower order elements or by a
//* decimal fraction). This pattern resolves this conflict the
//* following way: Higher order elements can be omitted in the date
//* part of the expression following the solidus (in case of omitting
//* the weeks also the "W" is omitted!) but not in the time part. The
//* time part may be of reduced accuracy.
//* @remark There is no requirement in ISO8601 to keep reduced accuracy
//* compatible in the start and the end date/time; this may result
//* "strange" or in some cases unclear (in these cases agreement is
//* required between the communicating sides) time interval
//* representations, however these are allowed by this template
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartEndExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}({nc.month}{dash}{nc.dayOfMonth}|" &
"{nc.dayOfYear}|{nc.week}{dash}{nc.dayOfWeek})T({nc.hour}{colon}" &
"({nc.minute}({colon}({nc.second}{nc.sFraction}#(,1)|60)|{nc.mFraction})" &
"#(,1)|60)|{nc.endOfDayExt}){nc.optZorTimeZoneExt}/({nc.yearExpansionOpt}" &
"{nc.year}({dash}{nc.month}{dash}{nc.dayOfMonth}|{dash}{nc.dayOfYear}|" &
"{dash}{nc.week}{dash}{nc.dayOfWeek})|({nc.month}{dash})#(,1)" &
"{nc.dayOfMonth}|{nc.week}{dash}{nc.dayOfWeek})T({nc.hour}{colon}" &
"({nc.minute}({colon}({nc.second}{nc.sFraction}#(,1)|60)|{nc.mFraction})" &
"#(,1)|60)|{nc.endOfDayExt}){nc.optZorTimeZoneExt}"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy (see note below)time
//* interval representations identified by start and end and using the basic
//* or the extended format
//*
//* @remark $ 4.4.4.5 is contradictory as allows omitting higher order time
//* elements in the part representing end date/time (the expression
//* after the solidus), while the time part may also be of reduced
//* accuracy (either by omitting the lower order elements or by a
//* decimal fraction). This pattern resolves this conflict the
//* following way: Higher order elements can be omitted in the date
//* part of the expression following the solidus (in case of omitting
//* the weeks also the "W" is omitted!) but not in the time part. The
//* time part may be of reduced accuracy.
//* @remark There is no requirement in ISO8601 to keep reduced accuracy
//* compatible in the start and the end date/time; this may result
//* "strange" or in some cases unclear (in these cases agreement is
//* required between the communicating sides) time interval
//* representations, however these are allowed by this template
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartEnd := (
t_ISO8601IntervalStartEndBasic,
t_ISO8601IntervalStartEndExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by start and duration and using the basic
//* format
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartDurationBasic := pattern
"{nc.yearExpansionOpt}{nc.year}({nc.month}{nc.dayOfMonth}|{nc.dayOfYear}|" &
"{nc.week}{nc.dayOfWeek})T({nc.hour}({nc.minute}({nc.second}{nc.sFraction}" &
"#(,1)|60|{nc.mFraction})#(,1)|60|{nc.hFraction})#(,1){nc.optZorTimeZone}|" &
"{nc.endOfDay}{nc.optZorTimeZone})/P({nc.year}({nc.monthDurAlt}" &
"{nc.dayOfMonthDurAlt}|{nc.dayOfYearDurAlt})T{nc.hour}(({nc.minute}" &
"({nc.second}{nc.sFraction}#(,1)|{nc.mFraction})#(,1)|{nc.hFraction})" &
"#(,1))|({nc.nums}((Y({nc.nums}(M({nc.nums}(D{nc.durTime}#(,1)|" &
"{nc.dFraction}D)|{nc.durTime}#(,1))|{nc.dFraction}[MD]|D{nc.durTime}" &
"#(,1))|{nc.durTime}#(,1))|{nc.dFraction}[YMDW])|M({nc.nums}(D{nc.durTime}" &
"#(,1)|{nc.dFraction}D)|{nc.dFraction}D|{nc.durTime}#(,1))|D{nc.durTime}" &
"#(,1)|W{nc.durTime}#(,1))|{nc.durTime}))"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by start and duration and using the
//* extended format
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartDurationExtended := pattern
"{nc.yearExpansionOpt}{nc.year}{dash}({nc.month}{dash}{nc.dayOfMonth}|" &
"{nc.dayOfYear}|{nc.week}{dash}{nc.dayOfWeek})T({nc.hour}{colon}" &
"({nc.minute}({colon}({nc.second}{nc.sFraction}#(,1)|60)|{nc.mFraction})" &
"#(,1)|60){nc.optZorTimeZoneExt}|{nc.endOfDayExt}{nc.optZorTimeZoneExt})" &
"/P({nc.year}{dash}({nc.monthDurAlt}{dash}{nc.dayOfMonthDurAlt}|" &
"{nc.dayOfYearDurAlt})T{nc.hour}{colon}{nc.minute}({colon}{nc.second}" &
"{nc.sFraction}#(,1)|{nc.mFraction})#(,1)|({nc.nums}((Y({nc.nums}" &
"(M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.durTime}#(,1))|" &
"{nc.dFraction}[MD]|D{nc.durTime}#(,1))|{nc.durTime}#(,1))|{nc.dFraction}" &
"[YMDW])|M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.dFraction}D|" &
"{nc.durTime}#(,1))|D{nc.durTime}#(,1)|W{nc.durTime}#(,1))|{nc.durTime}))"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by start and duration and using either the
//* basic or the extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalStartDuration := (
t_ISO8601IntervalStartDurationBasic,
t_ISO8601IntervalStartDurationExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using the basic
//* format
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalDurationEndBasic := pattern
"P({nc.year}({nc.monthDurAlt}{nc.dayOfMonthDurAlt}|{nc.dayOfYearDurAlt})" &
"T{nc.hour}(({nc.minute}({nc.second}{nc.sFraction}#(,1)|{nc.mFraction})" &
"#(,1)|{nc.hFraction})#(,1))|({nc.nums}((Y({nc.nums}(M({nc.nums}" &
"(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.durTime}#(,1))|{nc.dFraction}" &
"[MD]|D{nc.durTime}#(,1))|{nc.durTime}#(,1))|{nc.dFraction}[YMDW])|" &
"M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.dFraction}D|" &
"{nc.durTime}#(,1))|D{nc.durTime}#(,1)|W{nc.durTime}#(,1))|" &
"{nc.durTime}))/{nc.yearExpansionOpt}{nc.year}({nc.month}{nc.dayOfMonth}|" &
"{nc.dayOfYear}|{nc.week}{nc.dayOfWeek})T({nc.hour}({nc.minute}" &
"({nc.second}{nc.sFraction}#(,1)|60|{nc.mFraction})#(,1)|60|" &
"{nc.hFraction})#(,1){nc.optZorTimeZone}|{nc.endOfDay}{nc.optZorTimeZone})"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using the extended
//* format
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalDurationEndExtended := pattern
"P({nc.year}{dash}({nc.monthDurAlt}{dash}{nc.dayOfMonthDurAlt}|" &
"{nc.dayOfYearDurAlt})T{nc.hour}{colon}{nc.minute}({colon}{nc.second}" &
"{nc.sFraction}#(,1)|{nc.mFraction})#(,1)|({nc.nums}((Y({nc.nums}" &
"(M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.durTime}#(,1))|" &
"{nc.dFraction}[MD]|D{nc.durTime}#(,1))|{nc.durTime}#(,1))|{nc.dFraction}" &
"[YMDW])|M({nc.nums}(D{nc.durTime}#(,1)|{nc.dFraction}D)|{nc.dFraction}D|" &
"{nc.durTime}#(,1))|D{nc.durTime}#(,1)|W{nc.durTime}#(,1))|{nc.durTime}))/" &
"{nc.yearExpansionOpt}{nc.year}{dash}({nc.month}{dash}{nc.dayOfMonth}|" &
"{nc.dayOfYear}|{nc.week}{dash}{nc.dayOfWeek})T({nc.hour}{colon}" &
"({nc.minute}({colon}({nc.second}{nc.sFraction}#(,1)|60)|{nc.mFraction})" &
"#(,1)|60){nc.optZorTimeZoneExt}|{nc.endOfDayExt}{nc.optZorTimeZoneExt})"
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using either the
//* basic or the extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalDurationEnd := (
t_ISO8601IntervalDurationEndBasic,
t_ISO8601IntervalDurationEndExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using either the
//* basic or the extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalBasic := (
t_ISO8601DurationBasic,
t_ISO8601IntervalStartEndBasic,
t_ISO8601IntervalStartDurationBasic,
t_ISO8601IntervalDurationEndBasic
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using either the
//* basic or the extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601IntervalExtended := (
t_ISO8601DurationExtended,
t_ISO8601IntervalStartEndExtended,
t_ISO8601IntervalStartDurationExtended,
t_ISO8601IntervalDurationEndExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4.4.3
//*
//* @desc Matches both complete and reduced accuracy time interval
//* representations identified by duration and end and using either the
//* basic or the extended formats
//*
//* @status verified
//*
//*****************************************************************************
template charstring t_ISO8601Interval := (
t_ISO8601IntervalBasic,
t_ISO8601IntervalExtended
)
//*****************************************************************************
//*
//* @reference ISO_8601 $4
//*
//* @desc Matches all ISO8601 date and time formats
//*
//* @remark Exceptions see at the members of the value list
//*
//* @status
//*
//*****************************************************************************
template charstring t_ISO8601AllFormats := (
t_ISO8601Date,
t_ISO8601Time,
t_ISO8601DateTime,
t_ISO8601DurationDesign,
t_ISO8601DurationAlternative,
t_ISO8601Interval
)
} // end of module