diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-03-04 11:03:26 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-03-04 11:03:26 +0000 |
commit | b929b5beba91a31e5dfdce5091c05ac51cb7e7bb (patch) | |
tree | 5e919873b1dd28d60f6bbf63a0eab1295218f8b2 | |
parent | ff79ad3854d86d564e0f6e96e0d12542542411b6 (diff) | |
download | libxslt-b929b5beba91a31e5dfdce5091c05ac51cb7e7bb.tar.gz libxslt-b929b5beba91a31e5dfdce5091c05ac51cb7e7bb.tar.bz2 libxslt-b929b5beba91a31e5dfdce5091c05ac51cb7e7bb.zip |
patch from Charles Bozeman for the exslt date extension added the
* libexslt/date.c: patch from Charles Bozeman for the exslt date
extension
* configure.in tests/exslt/Makefile.am tests/exslt/date/*: added
the associated regression test provided by Charles
Daniel
57 files changed, 2713 insertions, 60 deletions
@@ -1,3 +1,10 @@ +Mon Mar 4 12:01:34 CET 2002 Daniel Veillard <daniel@veillard.com> + + * libexslt/date.c: patch from Charles Bozeman for the exslt date + extension + * configure.in tests/exslt/Makefile.am tests/exslt/date/*: added + the associated regression test provided by Charles + Fri Mar 1 10:17:26 CET 2002 Daniel Veillard <daniel@veillard.com> * libxslt/preproc.c: Fixed #73088 with the associated patch diff --git a/configure.in b/configure.in index ba3dfb2a..62a72ceb 100644 --- a/configure.in +++ b/configure.in @@ -410,6 +410,7 @@ tests/exslt/functions/Makefile tests/exslt/math/Makefile tests/exslt/sets/Makefile tests/exslt/strings/Makefile +tests/exslt/date/Makefile doc/Makefile xslt-config libxslt.spec diff --git a/doc/libxslt-api.xml b/doc/libxslt-api.xml index 034b4c89..9595717a 100644 --- a/doc/libxslt-api.xml +++ b/doc/libxslt-api.xml @@ -576,7 +576,7 @@ <function name='xsltCalibrateAdjust' file='xsltutils'> <info>Used for to correct the calibration for xsltTimestamp()</info> <return type='void'/> - <arg name='delta' type='long'/> + <arg name='delta' type='long' info='a negative dealy value found '/> </function> <function name='xsltCallTemplate' file='transform'> <info>Process the xslt call-template node on the source node</info> diff --git a/doc/libxslt-decl.txt b/doc/libxslt-decl.txt index bb1ebdb3..eb1147c8 100644 --- a/doc/libxslt-decl.txt +++ b/doc/libxslt-decl.txt @@ -71,6 +71,42 @@ void <NAME>LIBXSLT_PUBLIC</NAME> #define LIBXSLT_PUBLIC </MACRO> +<MACRO> +<NAME>LIBXSLT_DOTTED_VERSION</NAME> +#define LIBXSLT_DOTTED_VERSION "1.0.12" +</MACRO> +<MACRO> +<NAME>LIBXSLT_VERSION</NAME> +#define LIBXSLT_VERSION 10012 +</MACRO> +<MACRO> +<NAME>LIBXSLT_VERSION_STRING</NAME> +#define LIBXSLT_VERSION_STRING "10012" +</MACRO> +<MACRO> +<NAME>WITH_XSLT_DEBUG</NAME> +#define WITH_XSLT_DEBUG +</MACRO> +<MACRO> +<NAME>DEBUG_MEMORY</NAME> +#define DEBUG_MEMORY +</MACRO> +<MACRO> +<NAME>DEBUG_MEMORY_LOCATION</NAME> +#define DEBUG_MEMORY_LOCATION +</MACRO> +<MACRO> +<NAME>ATTRIBUTE_UNUSED</NAME> +#define ATTRIBUTE_UNUSED +</MACRO> +<MACRO> +<NAME>LIBXSLT_PUBLIC</NAME> +#define LIBXSLT_PUBLIC __declspec(dllimport) +</MACRO> +<MACRO> +<NAME>LIBXSLT_PUBLIC</NAME> +#define LIBXSLT_PUBLIC +</MACRO> <FUNCTION> <NAME>xsltAddKey</NAME> <RETURNS>int </RETURNS> @@ -589,42 +625,6 @@ xsltTransformContextPtr ctxt,const xmlChar *name,const xmlChar *ns_uri void *ctxt,const xmlChar *name,const xmlChar *ns_uri </FUNCTION> <MACRO> -<NAME>LIBXSLT_DOTTED_VERSION</NAME> -#define LIBXSLT_DOTTED_VERSION "1.0.12" -</MACRO> -<MACRO> -<NAME>LIBXSLT_VERSION</NAME> -#define LIBXSLT_VERSION 10012 -</MACRO> -<MACRO> -<NAME>LIBXSLT_VERSION_STRING</NAME> -#define LIBXSLT_VERSION_STRING "10012" -</MACRO> -<MACRO> -<NAME>WITH_XSLT_DEBUG</NAME> -#define WITH_XSLT_DEBUG -</MACRO> -<MACRO> -<NAME>DEBUG_MEMORY</NAME> -#define DEBUG_MEMORY -</MACRO> -<MACRO> -<NAME>DEBUG_MEMORY_LOCATION</NAME> -#define DEBUG_MEMORY_LOCATION -</MACRO> -<MACRO> -<NAME>ATTRIBUTE_UNUSED</NAME> -#define ATTRIBUTE_UNUSED -</MACRO> -<MACRO> -<NAME>LIBXSLT_PUBLIC</NAME> -#define LIBXSLT_PUBLIC __declspec(dllimport) -</MACRO> -<MACRO> -<NAME>LIBXSLT_PUBLIC</NAME> -#define LIBXSLT_PUBLIC -</MACRO> -<MACRO> <NAME>XSLT_REGISTER_FUNCTION_LOOKUP</NAME> #define XSLT_REGISTER_FUNCTION_LOOKUP(ctxt) \ xmlXPathRegisterFuncLookup((ctxt)->xpathCtxt, \ diff --git a/doc/libxslt-refs.xml b/doc/libxslt-refs.xml index 762fb635..a051dd32 100644 --- a/doc/libxslt-refs.xml +++ b/doc/libxslt-refs.xml @@ -2417,6 +2417,9 @@ <word name='deallocator'> <ref name='xsltInitElemPreComp'/> </word> + <word name='dealy'> + <ref name='xsltCalibrateAdjust'/> + </word> <word name='debug'> <ref name='DEBUG_MEMORY'/> <ref name='WITH_XSLT_DEBUG'/> @@ -2686,6 +2689,7 @@ <ref name='xsltNumberFormat'/> </word> <word name='found'> + <ref name='xsltCalibrateAdjust'/> <ref name='xsltExtElementLookup'/> <ref name='xsltExtModuleElementLookup'/> <ref name='xsltExtModuleFunctionLookup'/> @@ -3182,6 +3186,9 @@ <word name='needs'> <ref name='xsltGetTemplate'/> </word> + <word name='negative'> + <ref name='xsltCalibrateAdjust'/> + </word> <word name='new'> <ref name='xsltAddStackElemList'/> <ref name='xsltAttrListTemplateProcess'/> diff --git a/libexslt/date.c b/libexslt/date.c index d457dbbf..15ba3bac 100644 --- a/libexslt/date.c +++ b/libexslt/date.c @@ -100,17 +100,20 @@ struct _exsltDate { #define VALID_DAY(day) ((day >= 1) && (day <= 31)) #define VALID_HOUR(hr) ((hr >= 0) && (hr <= 23)) #define VALID_MIN(min) ((min >= 0) && (min <= 59)) -#define VALID_SEC(sec) ((sec >= 0) && (sec <= 59)) +#define VALID_SEC(sec) ((sec >= 0) && (sec < 60)) #define VALID_TZO(tzo) ((tzo > -1440) && (tzo < 1440)) #define IS_LEAP(y) \ (((y % 4 == 0) && (y % 100 != 0)) || (y % 400 == 0)) static const int daysInMonth[12] = + { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; +static const int daysInMonthLeap[12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; #define VALID_MDAY(dt) \ - (((dt->mon == 2) && !IS_LEAP(dt->year) && (dt->day <= 28)) ||\ - (dt->day <= daysInMonth[dt->mon - 1])) + (IS_LEAP(dt->year) ? \ + (dt->day <= daysInMonthLeap[dt->mon - 1]) : \ + (dt->day <= daysInMonth[dt->mon - 1])) #define VALID_DATE(dt) \ (VALID_YEAR(dt->year) && VALID_MONTH(dt->mon) && VALID_MDAY(dt)) @@ -133,9 +136,6 @@ static const int dayInLeapYearByMonth[12] = dayInLeapYearByMonth[month - 1] : \ dayInYearByMonth[month - 1]) + day) -#define DAY_IN_WEEK(yday, yr) \ - (((yr-1)+((yr-1)/4)-((yr-1)/100)+((yr-1)/400)+yday) % 7) - /** * _exsltDateParseGYear: * @dt: pointer to a date structure @@ -272,11 +272,11 @@ _exsltDateParseGYear (exsltDatePtr dt, const xmlChar **str) { #define PARSE_FLOAT(num, cur, invalid) \ PARSE_2_DIGITS(num, cur, invalid); \ if (!invalid && (*cur == '.')) { \ + double mult = 1; \ cur++; \ if ((*cur < '0') || (*cur > '9')) \ invalid = 1; \ - while ((*cur < '0') || (*cur > '9')) { \ - static double mult = 1; \ + while ((*cur >= '0') && (*cur <= '9')) { \ mult /= 10; \ num += (*cur - '0') * mult; \ cur++; \ @@ -294,8 +294,14 @@ _exsltDateParseGYear (exsltDatePtr dt, const xmlChar **str) { */ #define FORMAT_FLOAT(num, cur) \ { \ - int tmp = (int) num; \ - FORMAT_2_DIGITS(tmp, cur); \ + xmlChar *sav, *str; \ + if (num < 10.0) \ + *cur++ = '0'; \ + str = xmlXPathCastNumberToString(num); \ + sav = str; \ + while (*str != 0) \ + *cur++ = *str++; \ + xmlFree(sav); \ } /** @@ -596,7 +602,7 @@ exsltDateCreateDate (void) { ret = (exsltDatePtr) xmlMalloc(sizeof(exsltDate)); if (ret == NULL) { xsltGenericError(xsltGenericErrorContext, - "exsltDateNewDate: out of memory\n"); + "exsltDateCreateDate: out of memory\n"); return (NULL); } memset (ret, 0, sizeof(exsltDate)); @@ -654,9 +660,9 @@ exsltDateCurrent (void) { /* determine the time zone offset from local to gm time */ gmTm = gmtime(&secs); ret->tz_flag = 0; - ret->tzo = -(((ret->day - gmTm->tm_mday) * 1440) + - ((ret->hour - gmTm->tm_hour) * 60) + - (ret->min - gmTm->tm_min)); + ret->tzo = (((ret->day * 1440) + (ret->hour * 60) + ret->min) - + ((gmTm->tm_mday * 1440) + (gmTm->tm_hour * 60) + + gmTm->tm_min)); return ret; } @@ -1229,6 +1235,34 @@ exsltDateMonthAbbreviation (const xmlChar *dateTime) { } /** + * _exsltDayInWeek: + * @yday: year day (1-366) + * @yr: year + * + * Determine the day-in-week from @yday and @yr. 0001-01-01 was + * a Monday so all other days are calculated from there. Take the + * number of years since (or before) add the number of leap years and + * the day-in-year and mod by 7. This is a function because negative + * years must be handled a little differently and there is no zero year. + * + * Returns day in week (Sunday = 0) + */ +static int +_exsltDateDayInWeek(int yday, long yr) +{ + int ret; + + if (yr < 0) { + ret = ((yr + (((yr+1)/4)-((yr+1)/100)+((yr+1)/400)) + yday) % 7); + if (ret < 0) + ret += 7; + } else + ret = (((yr-1) + (((yr-1)/4)-((yr-1)/100)+((yr-1)/400)) + yday) % 7); + + return ret; +} + +/** * exsltDateWeekInYear: * @dateTime: a date/time string * @@ -1271,8 +1305,12 @@ exsltDateWeekInYear (const xmlChar *dateTime) { } fdiy = DAY_IN_YEAR(1, 1, dt->year); - /* 0=Mon, 1=Tue, etc. */ - fdiw = (DAY_IN_WEEK(fdiy, dt->year) + 6) % 7; + + /* + * Determine day-in-week (0=Sun, 1=Mon, etc.) then adjust so Monday + * is the first day-in-week + */ + fdiw = (_exsltDateDayInWeek(fdiy, dt->year) + 6) % 7; ret = DAY_IN_YEAR(dt->day, dt->mon, dt->year) / 7; @@ -1328,11 +1366,11 @@ exsltDateWeekInMonth (const xmlChar *dateTime) { } fdiy = DAY_IN_YEAR(1, dt->mon, dt->year); - /* 0=Mon, 1=Tue, etc. */ - fdiw = DAY_IN_WEEK(fdiy, dt->year); - - /* adjust the fdiw value so that Sunday is last-day-in-week */ - fdiw = (fdiw != 0 ? (fdiw - 1) : 6); + /* + * Determine day-in-week (0=Sun, 1=Mon, etc.) then adjust so Monday + * is the first day-in-week + */ + fdiw = (_exsltDateDayInWeek(fdiy, dt->year) + 6) % 7; ret = ((dt->day + fdiw) / 7) + 1; @@ -1526,7 +1564,8 @@ exsltDateDayInWeek (const xmlChar *dateTime) { } diy = DAY_IN_YEAR(dt->day, dt->mon, dt->year); - ret = (double) DAY_IN_WEEK(diy, dt->year) + 1; + + ret = (double) _exsltDateDayInWeek(diy, dt->year) + 1; exsltDateFreeDate(dt); diff --git a/tests/exslt/Makefile.am b/tests/exslt/Makefile.am index b3ecdfa7..208877ca 100644 --- a/tests/exslt/Makefile.am +++ b/tests/exslt/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS=common functions math sets strings +SUBDIRS=common functions math sets strings date all: diff --git a/tests/exslt/date/Makefile.am b/tests/exslt/date/Makefile.am new file mode 100644 index 00000000..e5caefd7 --- /dev/null +++ b/tests/exslt/date/Makefile.am @@ -0,0 +1,55 @@ +## Process this file with automake to produce Makefile.in + +$(top_builddir)/xsltproc/xsltproc: + @(cd ../../../xsltproc ; $(MAKE) xsltproc) + +EXTRA_DIST = \ + current.xsl \ + date.1.out date.1.xml date.1.xsl \ + date.2.out date.2.xml date.2.xsl \ + datetime.1.out datetime.1.xml datetime.1.xsl \ + datetime.2.out datetime.2.xml datetime.2.xsl \ + gday.1.out gday.1.xml gday.1.xsl \ + gday.2.out gday.2.xml gday.2.xsl \ + gmonth.1.out gmonth.1.xml gmonth.1.xsl \ + gmonth.2.out gmonth.2.xml gmonth.2.xsl \ + gmonthday.1.out gmonthday.1.xml gmonthday.1.xsl \ + gmonthday.2.out gmonthday.2.xml gmonthday.2.xsl \ + gyear.1.out gyear.1.xml gyear.1.xsl \ + gyear.2.out gyear.2.xml gyear.2.xsl \ + gyearmonth.1.out gyearmonth.1.xml gyearmonth.1.xsl \ + gyearmonth.2.out gyearmonth.2.xml gyearmonth.2.xsl \ + time.1.out time.1.xml time.1.xsl \ + time.2.out time.2.xml time.2.xsl + +all: + +test-current: + @(echo > .memdump) + @echo \<doc/\> >current.xml + @echo "#" + @echo "# Inspect the following for correctness" + @echo "#" + @(for i in $(srcdir)/current.xsl ; do \ + name=`basename $$i .xsl` ; \ + if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \ + $(top_builddir)/xsltproc/xsltproc $(srcdir)/$$name.xsl $(srcdir)/$$name.xml;\ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ + done) + @rm -f current.xml + +test tests: $(top_builddir)/xsltproc/xsltproc test-current + @(echo > .memdump) + @(for i in $(srcdir)/*.xsl ; do \ + name=`basename $$i .xsl` ; \ + if [ ! -f $(srcdir)/$$name.xml ] ; then continue ; fi ; \ + echo $$name.xml ; \ + $(top_builddir)/xsltproc/xsltproc $(srcdir)/$$name.xsl $(srcdir)/$$name.xml > $$name.res;\ + if [ ! -f $(srcdir)/$$name.out ] ; then cp $$name.res $(srcdir)/$$name.out ; \ + else if [ ! -s $$name.res ] ; then echo "Fatal error, no $$name.res\n" ; \ + else diff $(srcdir)/$$name.out $$name.res ; fi ; fi; \ + grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" || true;\ + rm -f $$name.res ; \ + done) + + diff --git a/tests/exslt/date/current.xsl b/tests/exslt/date/current.xsl new file mode 100644 index 00000000..4cbe7bfb --- /dev/null +++ b/tests/exslt/date/current.xsl @@ -0,0 +1,47 @@ +<?xml version="1.0"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="/">
+ <xsl:message>Current Date : <xsl:value-of select="date:date-time()"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year()"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year()"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year()"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name()"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation()"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year()"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year()"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month()"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month()"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week()"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name()"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation()"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time()"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day()"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour()"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute()"/>
+ </xsl:message>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/date.1.out b/tests/exslt/date/date.1.out new file mode 100644 index 00000000..2d3eb619 --- /dev/null +++ b/tests/exslt/date/date.1.out @@ -0,0 +1,92 @@ + + + + Test Date : 0001-12-31Z + year : 1 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 53 + day-in-year : 365 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 2 + day-name : Monday + day-abbreviation : Mon + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 3000-01-31 + year : 3000 + leap-year : false + month-in-year : 1 + month-name : January + month-abbreviation : Jan + week-in-year : 5 + day-in-year : 31 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 6 + day-name : Friday + day-abbreviation : Fri + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2000-02-29 + year : 2000 + leap-year : true + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : 8 + day-in-year : 60 + day-in-month : 29 + day-of-week-in-month : 5 + day-in-week : 3 + day-name : Tuesday + day-abbreviation : Tue + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 9990001-12-31Z + year : 9990001 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 53 + day-in-year : 365 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 2 + day-name : Monday + day-abbreviation : Mon + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : -0004-02-29 + year : -4 + leap-year : true + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : 9 + day-in-year : 60 + day-in-month : 29 + day-of-week-in-month : 5 + day-in-week : 1 + day-name : Sunday + day-abbreviation : Sun + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/date.1.xml b/tests/exslt/date/date.1.xml new file mode 100644 index 00000000..0d9c8eb7 --- /dev/null +++ b/tests/exslt/date/date.1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:date -->
+ <date date="0001-12-31Z"/>
+ <date date="3000-01-31"/>
+ <date date="2000-02-29"/>
+ <date date="9990001-12-31Z"/>
+ <date date="-0004-02-29"/>
+</page>
+
diff --git a/tests/exslt/date/date.1.xsl b/tests/exslt/date/date.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/date.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/date.2.out b/tests/exslt/date/date.2.out new file mode 100644 index 00000000..bf52b7a1 --- /dev/null +++ b/tests/exslt/date/date.2.out @@ -0,0 +1,93 @@ + + + + Test Date : -1-01-31 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : +1-01-31 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : 0001-12-32Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 0001-13-01 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 0001-11-00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/date.2.xml b/tests/exslt/date/date.2.xml new file mode 100644 index 00000000..183504b3 --- /dev/null +++ b/tests/exslt/date/date.2.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:date syntax -->
+ <date date="-1-01-31"/>
+ <date date="+1-01-31"/>
+ <!-- invalid xs:date values -->
+ <date date="0001-12-32Z"/>
+ <date date="0001-13-01"/>
+ <date date="0001-11-00"/>
+</page>
+
diff --git a/tests/exslt/date/date.2.xsl b/tests/exslt/date/date.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/date.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/datetime.1.out b/tests/exslt/date/datetime.1.out new file mode 100644 index 00000000..7ea9826b --- /dev/null +++ b/tests/exslt/date/datetime.1.out @@ -0,0 +1,92 @@ + + + + Test Date : 2001-02-28T10:31:07 + year : 2001 + leap-year : false + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : 9 + day-in-year : 59 + day-in-month : 28 + day-of-week-in-month : 5 + day-in-week : 4 + day-name : Wednesday + day-abbreviation : Wed + time : 10:31:07 + hour-in-day : 10 + minute-in-hour : 31 + second-in-minute : 7 + + Test Date : 0001-12-31T23:59:59.1234-05:00 + year : 1 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 53 + day-in-year : 365 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 2 + day-name : Monday + day-abbreviation : Mon + time : 23:59:59.1234-05:00 + hour-in-day : 23 + minute-in-hour : 59 + second-in-minute : 59.1234 + + Test Date : -0001-12-31T23:59:59-05:00 + year : -1 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 52 + day-in-year : 365 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 1 + day-name : Sunday + day-abbreviation : Sun + time : 23:59:59-05:00 + hour-in-day : 23 + minute-in-hour : 59 + second-in-minute : 59 + + Test Date : 10000-12-31T23:59:59.9901Z + year : 10000 + leap-year : true + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 52 + day-in-year : 366 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 1 + day-name : Sunday + day-abbreviation : Sun + time : 23:59:59.9901Z + hour-in-day : 23 + minute-in-hour : 59 + second-in-minute : 59.9901 + + Test Date : -10000-12-31T23:59:59Z + year : -10000 + leap-year : true + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : 53 + day-in-year : 366 + day-in-month : 31 + day-of-week-in-month : 5 + day-in-week : 4 + day-name : Wednesday + day-abbreviation : Wed + time : 23:59:59Z + hour-in-day : 23 + minute-in-hour : 59 + second-in-minute : 59 diff --git a/tests/exslt/date/datetime.1.xml b/tests/exslt/date/datetime.1.xml new file mode 100644 index 00000000..bbbf23d4 --- /dev/null +++ b/tests/exslt/date/datetime.1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:dateTime -->
+ <date date="2001-02-28T10:31:07"/>
+ <date date='0001-12-31T23:59:59.1234-05:00'/>
+ <date date='-0001-12-31T23:59:59-05:00'/>
+ <date date='10000-12-31T23:59:59.9901Z'/>
+ <date date='-10000-12-31T23:59:59Z'/>
+</page>
+
diff --git a/tests/exslt/date/datetime.1.xsl b/tests/exslt/date/datetime.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/datetime.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/datetime.2.out b/tests/exslt/date/datetime.2.out new file mode 100644 index 00000000..7f76ed88 --- /dev/null +++ b/tests/exslt/date/datetime.2.out @@ -0,0 +1,309 @@ + + + + Test Date : 2001-02-2810:31:07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-2810:31:07Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28t10:31:07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28T10:31:07z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 02001-02-28T10-31-07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-2810:31:07-6:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-2810:31:07-06:00Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 01-02-28T10:31:07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 02001-02-28T10:31:07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : -001-02-28T10:31:07Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-2-28T10:31:07-06:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-2T10:31:07-06:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28T1:31:07-06:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28T10:1:07-06:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28T10:31:7-06:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2001-02-28T10:31:07-06 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : 2001-02-29T10:31:07Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/datetime.2.xml b/tests/exslt/date/datetime.2.xml new file mode 100644 index 00000000..abf27524 --- /dev/null +++ b/tests/exslt/date/datetime.2.xml @@ -0,0 +1,22 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:dateTime syntax -->
+ <date date="2001-02-2810:31:07"/>
+ <date date="2001-02-2810:31:07Z"/>
+ <date date="2001-02-28t10:31:07"/>
+ <date date="2001-02-28T10:31:07z"/>
+ <date date="02001-02-28T10-31-07"/>
+ <date date="2001-02-2810:31:07-6:00"/>
+ <date date="2001-02-2810:31:07-06:00Z"/>
+ <date date="01-02-28T10:31:07"/>
+ <date date="02001-02-28T10:31:07"/>
+ <date date="-001-02-28T10:31:07Z"/>
+ <date date="2001-2-28T10:31:07-06:00"/>
+ <date date="2001-02-2T10:31:07-06:00"/>
+ <date date="2001-02-28T1:31:07-06:00"/>
+ <date date="2001-02-28T10:1:07-06:00"/>
+ <date date="2001-02-28T10:31:7-06:00"/>
+ <date date="2001-02-28T10:31:07-06"/>
+ <!-- invalid xs:dateTime values -->
+ <date date="2001-02-29T10:31:07Z"/>
+</page>
diff --git a/tests/exslt/date/datetime.2.xsl b/tests/exslt/date/datetime.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/datetime.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gday.1.out b/tests/exslt/date/gday.1.out new file mode 100644 index 00000000..ccb53401 --- /dev/null +++ b/tests/exslt/date/gday.1.out @@ -0,0 +1,74 @@ + + + + Test Date : ---11 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : 11 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : ---31 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : 31 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : ---01 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : 1 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : ---25 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : 25 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gday.1.xml b/tests/exslt/date/gday.1.xml new file mode 100644 index 00000000..e8308e7e --- /dev/null +++ b/tests/exslt/date/gday.1.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:gDay -->
+ <date date="---11"/>
+ <date date="---31"/>
+ <date date="---01"/>
+ <date date="---25"/>
+</page>
+
diff --git a/tests/exslt/date/gday.1.xsl b/tests/exslt/date/gday.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gday.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gday.2.out b/tests/exslt/date/gday.2.out new file mode 100644 index 00000000..c9a3fef5 --- /dev/null +++ b/tests/exslt/date/gday.2.out @@ -0,0 +1,75 @@ + + + + Test Date : --09- + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : ---9 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : ---32 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : ---00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gday.2.xml b/tests/exslt/date/gday.2.xml new file mode 100644 index 00000000..5ea28968 --- /dev/null +++ b/tests/exslt/date/gday.2.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:gDay syntax -->
+ <date date="--09-"/>
+ <date date="---9"/>
+ <!-- invalid xs:gDay values -->
+ <date date="---32"/>
+ <date date="---00"/>
+</page>
+
diff --git a/tests/exslt/date/gday.2.xsl b/tests/exslt/date/gday.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gday.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gmonth.1.out b/tests/exslt/date/gmonth.1.out new file mode 100644 index 00000000..621f7991 --- /dev/null +++ b/tests/exslt/date/gmonth.1.out @@ -0,0 +1,74 @@ + + + + Test Date : --12-- + year : NaN + leap-year : NaN + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --06-- + year : NaN + leap-year : NaN + month-in-year : 6 + month-name : June + month-abbreviation : Jun + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --02-- + year : NaN + leap-year : NaN + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --11-- + year : NaN + leap-year : NaN + month-in-year : 11 + month-name : November + month-abbreviation : Nov + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gmonth.1.xml b/tests/exslt/date/gmonth.1.xml new file mode 100644 index 00000000..495b88e0 --- /dev/null +++ b/tests/exslt/date/gmonth.1.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:gMonth -->
+ <date date="--12--"/>
+ <date date="--06--"/>
+ <date date="--02--"/>
+ <date date="--11--"/>
+</page>
+
diff --git a/tests/exslt/date/gmonth.1.xsl b/tests/exslt/date/gmonth.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gmonth.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gmonth.2.out b/tests/exslt/date/gmonth.2.out new file mode 100644 index 00000000..6aa8dbb7 --- /dev/null +++ b/tests/exslt/date/gmonth.2.out @@ -0,0 +1,57 @@ + + + + Test Date : --09- + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : --00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --13 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gmonth.2.xml b/tests/exslt/date/gmonth.2.xml new file mode 100644 index 00000000..aa24e95f --- /dev/null +++ b/tests/exslt/date/gmonth.2.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:gMonth syntax -->
+ <date date="--09-"/>
+ <!-- invalid xs:gMonth values -->
+ <date date="--00"/>
+ <date date="--13"/>
+</page>
+
diff --git a/tests/exslt/date/gmonth.2.xsl b/tests/exslt/date/gmonth.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gmonth.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gmonthday.1.out b/tests/exslt/date/gmonthday.1.out new file mode 100644 index 00000000..24ef4d65 --- /dev/null +++ b/tests/exslt/date/gmonthday.1.out @@ -0,0 +1,110 @@ + + + + Test Date : --01-01 + year : NaN + leap-year : NaN + month-in-year : 1 + month-name : January + month-abbreviation : Jan + week-in-year : NaN + day-in-year : NaN + day-in-month : 1 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --02-28 + year : NaN + leap-year : NaN + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : NaN + day-in-year : NaN + day-in-month : 28 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --06-04 + year : NaN + leap-year : NaN + month-in-year : 6 + month-name : June + month-abbreviation : Jun + week-in-year : NaN + day-in-year : NaN + day-in-month : 4 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --09-01 + year : NaN + leap-year : NaN + month-in-year : 9 + month-name : September + month-abbreviation : Sep + week-in-year : NaN + day-in-year : NaN + day-in-month : 1 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --10-31 + year : NaN + leap-year : NaN + month-in-year : 10 + month-name : October + month-abbreviation : Oct + week-in-year : NaN + day-in-year : NaN + day-in-month : 31 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --12-31 + year : NaN + leap-year : NaN + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : NaN + day-in-year : NaN + day-in-month : 31 + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gmonthday.1.xml b/tests/exslt/date/gmonthday.1.xml new file mode 100644 index 00000000..25d24747 --- /dev/null +++ b/tests/exslt/date/gmonthday.1.xml @@ -0,0 +1,11 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:gMonthDay -->
+ <date date="--01-01"/>
+ <date date="--02-28"/>
+ <date date="--06-04"/>
+ <date date="--09-01"/>
+ <date date="--10-31"/>
+ <date date="--12-31"/>
+</page>
+
diff --git a/tests/exslt/date/gmonthday.1.xsl b/tests/exslt/date/gmonthday.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gmonthday.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gmonthday.2.out b/tests/exslt/date/gmonthday.2.out new file mode 100644 index 00000000..c5623362 --- /dev/null +++ b/tests/exslt/date/gmonthday.2.out @@ -0,0 +1,57 @@ + + + + Test Date : ---09-01 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : --09-01- + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : --01-00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gmonthday.2.xml b/tests/exslt/date/gmonthday.2.xml new file mode 100644 index 00000000..23c6f405 --- /dev/null +++ b/tests/exslt/date/gmonthday.2.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:gMonthDay syntax -->
+ <date date="---09-01"/>
+ <date date="--09-01-"/>
+ <!-- invalid xs:gMonthDay values -->
+ <date date="--01-00"/>
+</page>
+
diff --git a/tests/exslt/date/gmonthday.2.xsl b/tests/exslt/date/gmonthday.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gmonthday.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gyear.1.out b/tests/exslt/date/gyear.1.out new file mode 100644 index 00000000..9a7b2918 --- /dev/null +++ b/tests/exslt/date/gyear.1.out @@ -0,0 +1,92 @@ + + + + Test Date : 0001 + year : 1 + leap-year : false + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 3000 + year : 3000 + leap-year : false + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2000 + year : 2000 + leap-year : true + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 9990001 + year : 9990001 + leap-year : false + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : -0004 + year : -4 + leap-year : true + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gyear.1.xml b/tests/exslt/date/gyear.1.xml new file mode 100644 index 00000000..95d776b0 --- /dev/null +++ b/tests/exslt/date/gyear.1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:gYear -->
+ <date date="0001"/>
+ <date date="3000"/>
+ <date date="2000"/>
+ <date date="9990001"/>
+ <date date="-0004"/>
+</page>
+
diff --git a/tests/exslt/date/gyear.1.xsl b/tests/exslt/date/gyear.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gyear.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gyear.2.out b/tests/exslt/date/gyear.2.out new file mode 100644 index 00000000..801bfe07 --- /dev/null +++ b/tests/exslt/date/gyear.2.out @@ -0,0 +1,39 @@ + + + + Test Date : 00010 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : 0000 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gyear.2.xml b/tests/exslt/date/gyear.2.xml new file mode 100644 index 00000000..9c571825 --- /dev/null +++ b/tests/exslt/date/gyear.2.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:gYear syntax -->
+ <date date="00010"/>
+ <!-- invalid xs:gYear values -->
+ <date date="0000"/>
+</page>
+
diff --git a/tests/exslt/date/gyear.2.xsl b/tests/exslt/date/gyear.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gyear.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gyearmonth.1.out b/tests/exslt/date/gyearmonth.1.out new file mode 100644 index 00000000..57580c76 --- /dev/null +++ b/tests/exslt/date/gyearmonth.1.out @@ -0,0 +1,92 @@ + + + + Test Date : 0001-12 + year : 1 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 3000-01 + year : 3000 + leap-year : false + month-in-year : 1 + month-name : January + month-abbreviation : Jan + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 2000-02 + year : 2000 + leap-year : true + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 9990001-12 + year : 9990001 + leap-year : false + month-in-year : 12 + month-name : December + month-abbreviation : Dec + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : -0004-02 + year : -4 + leap-year : true + month-in-year : 2 + month-name : February + month-abbreviation : Feb + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gyearmonth.1.xml b/tests/exslt/date/gyearmonth.1.xml new file mode 100644 index 00000000..08a7d29b --- /dev/null +++ b/tests/exslt/date/gyearmonth.1.xml @@ -0,0 +1,10 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:gYearMonth -->
+ <date date="0001-12"/>
+ <date date="3000-01"/>
+ <date date="2000-02"/>
+ <date date="9990001-12"/>
+ <date date="-0004-02"/>
+</page>
+
diff --git a/tests/exslt/date/gyearmonth.1.xsl b/tests/exslt/date/gyearmonth.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gyearmonth.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/gyearmonth.2.out b/tests/exslt/date/gyearmonth.2.out new file mode 100644 index 00000000..9cf3c5f4 --- /dev/null +++ b/tests/exslt/date/gyearmonth.2.out @@ -0,0 +1,39 @@ + + + + Test Date : 0010-8 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : 0001-13 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/gyearmonth.2.xml b/tests/exslt/date/gyearmonth.2.xml new file mode 100644 index 00000000..99cb5b7f --- /dev/null +++ b/tests/exslt/date/gyearmonth.2.xml @@ -0,0 +1,8 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:gYearMonth syntax -->
+ <date date="0010-8"/>
+ <!-- invalid xs:gYearMonth values -->
+ <date date="0001-13"/>
+</page>
+
diff --git a/tests/exslt/date/gyearmonth.2.xsl b/tests/exslt/date/gyearmonth.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/gyearmonth.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/time.1.out b/tests/exslt/date/time.1.out new file mode 100644 index 00000000..8151b0ae --- /dev/null +++ b/tests/exslt/date/time.1.out @@ -0,0 +1,128 @@ + + + + Test Date : 00:00:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 00:00:00 + hour-in-day : 0 + minute-in-hour : 0 + second-in-minute : 0 + + Test Date : 23:59:59 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 23:59:59 + hour-in-day : 23 + minute-in-hour : 59 + second-in-minute : 59 + + Test Date : 11:11:11 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 11:11:11 + hour-in-day : 11 + minute-in-hour : 11 + second-in-minute : 11 + + Test Date : 22:22:22 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 22:22:22 + hour-in-day : 22 + minute-in-hour : 22 + second-in-minute : 22 + + Test Date : 23:33:33 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 23:33:33 + hour-in-day : 23 + minute-in-hour : 33 + second-in-minute : 33 + + Test Date : 14:44:44 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 14:44:44 + hour-in-day : 14 + minute-in-hour : 44 + second-in-minute : 44 + + Test Date : 15:55:55 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : 15:55:55 + hour-in-day : 15 + minute-in-hour : 55 + second-in-minute : 55 diff --git a/tests/exslt/date/time.1.xml b/tests/exslt/date/time.1.xml new file mode 100644 index 00000000..27767602 --- /dev/null +++ b/tests/exslt/date/time.1.xml @@ -0,0 +1,12 @@ +<?xml version="1.0"?>
+<page>
+ <!-- valid xs:time -->
+ <date date="00:00:00"/>
+ <date date="23:59:59"/>
+ <date date="11:11:11"/>
+ <date date="22:22:22"/>
+ <date date="23:33:33"/>
+ <date date="14:44:44"/>
+ <date date="15:55:55"/>
+</page>
+
diff --git a/tests/exslt/date/time.1.xsl b/tests/exslt/date/time.1.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/time.1.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/tests/exslt/date/time.2.out b/tests/exslt/date/time.2.out new file mode 100644 index 00000000..2a1ee01d --- /dev/null +++ b/tests/exslt/date/time.2.out @@ -0,0 +1,165 @@ + + + + Test Date : 10:31:07z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : T10:31:07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 10:31-07 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 10:31:07-6:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 10:31:07-06:00Z + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + + Test Date : 00:00:00+24:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 24:00:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 00:60:00 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN + + Test Date : 00:00:60 + year : NaN + leap-year : NaN + month-in-year : NaN + month-name : + month-abbreviation : + week-in-year : NaN + day-in-year : NaN + day-in-month : NaN + day-of-week-in-month : NaN + day-in-week : NaN + day-name : + day-abbreviation : + time : + hour-in-day : NaN + minute-in-hour : NaN + second-in-minute : NaN diff --git a/tests/exslt/date/time.2.xml b/tests/exslt/date/time.2.xml new file mode 100644 index 00000000..0db9cb4b --- /dev/null +++ b/tests/exslt/date/time.2.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?>
+<page>
+ <!-- invalid xs:time syntax -->
+ <date date="10:31:07z"/>
+ <date date="T10:31:07"/>
+ <date date="10:31-07"/>
+ <date date="10:31:07-6:00"/>
+ <date date="10:31:07-06:00Z"/>
+ <!-- invalid xs:time values -->
+ <date date="00:00:00+24:00"/>
+ <date date="24:00:00"/>
+ <date date="00:60:00"/>
+ <date date="00:00:60"/>
+</page>
+
diff --git a/tests/exslt/date/time.2.xsl b/tests/exslt/date/time.2.xsl new file mode 100644 index 00000000..06ffd8d6 --- /dev/null +++ b/tests/exslt/date/time.2.xsl @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:date="http://exslt.org/dates-and-times"
+ extension-element-prefixes="date">
+
+<xsl:output method="text"/>
+
+<xsl:template match="date">
+ Test Date : <xsl:value-of select="@date"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ year : <xsl:value-of select="date:year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gYear; else NaN -->
+ leap-year : <xsl:value-of select="date:leap-year(@date)"/>
+ <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
+ month-in-year : <xsl:value-of select="date:month-in-year(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-name : <xsl:value-of select="date:month-name(@date)"/>
+ <!-- dateTime, date, gYearMonth or gMonth; else '' -->
+ month-abbreviation : <xsl:value-of select="date:month-abbreviation(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ week-in-year : <xsl:value-of select="date:week-in-year(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-year : <xsl:value-of select="date:day-in-year(@date)"/>
+ <!-- dateTime, date, gMonthDay or gDay; else NaN -->
+ day-in-month : <xsl:value-of select="date:day-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
+ <!-- dateTime, date; else NaN -->
+ day-in-week : <xsl:value-of select="date:day-in-week(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-name : <xsl:value-of select="date:day-name(@date)"/>
+ <!-- dateTime or date; else NaN -->
+ day-abbreviation : <xsl:value-of select="date:day-abbreviation(@date)"/>
+ <!-- dateTime or time; else '' -->
+ time : <xsl:value-of select="date:time(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ hour-in-day : <xsl:value-of select="date:hour-in-day(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ minute-in-hour : <xsl:value-of select="date:minute-in-hour(@date)"/>
+ <!-- dateTime or time; else NaN -->
+ second-in-minute : <xsl:value-of select="date:second-in-minute(@date)"/>
+</xsl:template>
+
+</xsl:stylesheet>
+
|