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
13.61Mb size Format: txt, pdf, ePub
ads
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.

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
13.61Mb size Format: txt, pdf, ePub
ads

Other books

Alpha Billionaire 3 by Helen Cooper
The Shadow Prince by Bree Despain
Soldier Mine by Amber Kell
Breach of Power by Chuck Barrett
A Deviant Breed by Stephen Coill
Fresh Blood by Jennifer Colgan
The Shelters of Stone by Jean M. Auel