Localization (natural language support)
When using ICU localization of number formatting (see Numbers and dates from ICU) in SaxonJ-PE or SaxonJ-EE, ICU rule names may now be specified directly as suggested in the XSLT 3.0 and the Functions and Operators 3.0 specifications. For example:
-
In xsl:number, you can write
format="w" lang="de" ordinal="%spellout-ordinal-masculine"
to get numbers formatted as German words, using the named ICU spellout rule. Note that the rule does not have to be one for ordinal numbering; you would request a cardinal numbering rule in the same way (the attribute name is a misnomer). -
In fn:format-integer(), you can write
fn:format-integer($n, 'wc;o(%spellout-ordinal-masculine)', 'de')
orfn:format-integer($n, 'wc;c(%spellout-ordinal-masculine)', 'de')
to achieve the same effect. If you use a spellout rule name in this way, it doesn't matter whether you requestc
for cardinal numbering oro
for ordinal numbering: the spellout rule name takes precedence.
To support this, there have been some minor changes in the Numberer
API, which will affect applications that
implement net.sf.saxon.lib.Numberer or that extend one of its Saxon-supplied
implementations. Specifically, an extra argument (cardinal
) has been added to the methods format
and
toWords
. Implementations are free to ignore this argument.
From Saxon 12.1, the ICU library is updated from version 59.2 to version 72.1, which supports Unicode 14.