<date:date-format> XSLT

The date:date-format element declares a date format, which controls the interpretation of a format pattern used by the date:format-date and date:parse-date functions.

Синтаксис

EXSLT

<date:date-format
    name = "qname"
    calendar = "gregorian | qname-but-not-ncname"
    lang = "language"
    first-day-of-week = "sunday | monday | tuesday | wednesday | thursday | friday | saturday | string" />

Описание и примеры

If there is a name attribute, then the element declares a named date format; otherwise, it declares the default date format. The value of the name attribute is a QName, which is expanded as described in 2.4 Qualified Names of XSLT. It is an error to declare either the default date format or a date format with a given name more than once (even with different import precedence), unless it is declared every time with the same value for all attributes (taking into account any default values).

The calendar attribute specifies the calendar used to interpret format strings using the date format. The value must be a QName. If the QName does not have a prefix, then it identifies calendar specified in this document and must be gregorian. If the QName has a prefix, then the QName is expanded into an expanded-name as described in 2.4 Qualified Names of XSLT; the expanded-name identifies the calendar; the interpretation of the format pattern used in the date:format-date and date:parse-date functions in this case is not specified by this document. If the processor does not support the calendar used by the date format used in these functions, the result of these functions is an empty string ('').

If there is no calendar attribute or it has the value gregorian, then the date/time being processed is interpreted as using the Gregorian calendar, with the same assumptions as made by the JDK 1.1 GregorianCalendar class. If this date format is used by the date:format-date or date:parse-date function, then the format pattern strings that they use must be in the syntax specified by the JDK 1.1 SimpleDateFormat class. The format pattern string is interpreted as described for the JDK 1.1 SimpleDateFormat class.

The lang attribute specifies the language of the strings used in formatting the date; it has the same range of values as xml:lang XML; if no lang value is specified or if the processor does not support the specified language, the language should be determined from the system environment.

The first-day-in-week attribute specifies the day that's used as the first day of the week for calculating numbers of the week in month, week in year and day in week. If the calendar is Gregorian, then it must be one of the strings sunday, monday, tuesday, wednesday, thursday, friday or saturday. Otherwise the values are restricted based on the calendar being used for the date format.

Implementations

There are currently no XSLT processors that we know of that support date:date-format natively.

There are currently no third-party implementations of date:date-format.