xref: /PHP-7.3/ext/xsl/tests/exslt.xsl (revision 42ade33f)
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4                xmlns:date="http://exslt.org/dates-and-times"
5                extension-element-prefixes="date">
6
7<xsl:output method="text"/>
8
9<xsl:template match="date">
10  Test Date : <xsl:value-of select="@date"/>
11    <!-- dateTime, date, gYearMonth or gYear; else NaN -->
12    year                 : <xsl:value-of select="date:year(@date)"/>
13    <!-- dateTime, date, gYearMonth or gYear; else NaN -->
14    leap-year            : <xsl:value-of select="date:leap-year(@date)"/>
15    <!-- dateTime, date, gYearMonth, gMonth or gMonthDay; else NaN -->
16    month-in-year        : <xsl:value-of select="date:month-in-year(@date)"/>
17    <!-- dateTime, date, gYearMonth or gMonth; else '' -->
18    month-name           : <xsl:value-of select="date:month-name(@date)"/>
19    <!-- dateTime, date, gYearMonth or gMonth; else '' -->
20    month-abbreviation   : <xsl:value-of select="date:month-abbreviation(@date)"/>
21    <!-- dateTime or date; else NaN -->
22    week-in-year         : <xsl:value-of select="date:week-in-year(@date)"/>
23    <!-- dateTime, date; else NaN -->
24    day-in-year          : <xsl:value-of select="date:day-in-year(@date)"/>
25    <!-- dateTime, date, gMonthDay or gDay; else NaN -->
26    day-in-month         : <xsl:value-of select="date:day-in-month(@date)"/>
27    <!-- dateTime, date; else NaN -->
28    day-of-week-in-month : <xsl:value-of select="date:day-of-week-in-month(@date)"/>
29    <!-- dateTime, date; else NaN -->
30    day-in-week          : <xsl:value-of select="date:day-in-week(@date)"/>
31    <!-- dateTime or date; else NaN -->
32    day-name             : <xsl:value-of select="date:day-name(@date)"/>
33    <!-- dateTime or date; else NaN -->
34    day-abbreviation     : <xsl:value-of select="date:day-abbreviation(@date)"/>
35    <!-- dateTime or time;  else '' -->
36    time                 : <xsl:value-of select="date:time(@date)"/>
37    <!-- dateTime or time;  else NaN -->
38    hour-in-day          : <xsl:value-of select="date:hour-in-day(@date)"/>
39    <!-- dateTime or time;  else NaN -->
40    minute-in-hour       : <xsl:value-of select="date:minute-in-hour(@date)"/>
41    <!-- dateTime or time;  else NaN -->
42    second-in-minute     : <xsl:value-of select="date:second-in-minute(@date)"/>
43</xsl:template>
44
45</xsl:stylesheet>
46