XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (562 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
9.01Mb size Format: txt, pdf, ePub
Character
Resulting Format
Example
1
Decimal numeric format with no leading zeroes: 1, 2, 3, …
1, 2, 3
01
Decimal format, two digits: 01, 02, 03, …
01, 02, 03
Other Unicode digit
Decimal numeric format, using the set of Unicode digits in which the given digit represents the value one.
i
Lower-case Roman numerals.
i, ii, iii, iv
I
Upper-case Roman numerals.
I, II, III, IV
N
Name of component, in upper case.
MONDAY, TUESDAY
n
Name of component, in lower case.
monday, tuesday
Nn
Name of component, in title case.
Monday, Tuesday
W
Number expressed in upper case words.
ONE, TWO, THREE
w
Number expressed in lower case words.
one, two, three
Ww
Number expressed in title case words.
One, Two, Three
t
Indicates so-called traditional numbering. The meaning of this depends on the language; it is intended to produce the same effect as
letter-value=“traditional”
in

. The requirement most often cited is for Hebrew numbering.
o
Indicates ordinal numbering. For example,
1o
gives
1st
,
2nd
,
3rd
… , while
wo
gives
first
,
second
,
third
, and
Wwo
gives
First
,
Second
,
Third
. All these examples are of course language dependent: the language is controlled using the
language
argument.

Not all combinations of these make sense, but the specification leaves it very open to implementations how to interpret combinations other than the obvious ones. The golden rule for this function is that so long as the syntax of the picture is correct, it is never supposed to raise an error—if the processor doesn't understand the format that you asked for, it should output the date in some fallback format.

The width modifier, if present, indicates how many digits or letters should be included in the result. It takes the form
,m
or
,m-n
, where
m
is a number giving the minimum width, or
*
to indicate no minimum, and
n
is the maximum width, or
*
to indicate no maximum. If
n
is omitted,
*
is assumed.

Other books

Never Let Go by Deborah Smith
The Fortunate Pilgrim by Mario Puzo
Tipping the Velvet by Sarah Waters
Between Friends by Lou Harper
All or Nothing by Kendall Ryan
From Fame to Shame by Blade, Veronica
The Honorable Barbarian by L. Sprague de Camp
Satin & Saddles by Cheyenne McCray
Hacedor de estrellas by Olaf Stapledon