Package net.sf.saxon.number


package net.sf.saxon.number

This package provides classes associated with numbering and the xsl:number element.

It is possible to extend the range of numberings available by providing a Numberer for a specific language. This should be named Numberer_xx where xx is the language code, corresponding to the value of the lang attribute in xsl:number.

The class Numberer_de is provided as an illustration of how to do this; it is invoked when the stylesheet specifies <xsl:number lang="de">, and a format token of "eins" is used: it allows numbers up to ten to be output as "eins", "zwei", "drei", etc.

The class Numberer_en provides the standard numbering options. As well as the format tokens defined in the XSLT 1.0 specification (for example, "1", "001", "a", "i") it supports other numbering options including:

    • Greek upper and lower case letters
      Cyrillic upper and lower case letters
      Hebrew letters
      Japanese: Hiragana-A, Hiragana-B, Katakana-A, or Katakana-B letters, and Kanji digits
      English words: the format token "one" produces numbers such as "twenty five"
  • These classes also include code to support the localization of dates as defined in the XSLT format-dateTime() group of functions.


    Michael H. Kay
    Saxonica Limited
    9 February 2005

    • Class
      Description
      Class AbstractNumberer is a base implementation of Numberer that provides language-independent default numbering This supports the xsl:number element.
      This class contains static utility methods to test whether a character is alphanumeric, as defined by the rules of xsl:number: that is, whether it is in one of the Unicode categories Nd, Nl, No, Lu, Ll, Lt, Lm or Lo
      This class attempts to identify a timezone name, given the date (including the time zone offset) and the country.
      Interface Numberer supports number formatting.
       
      Class Numberer_de is designed simply to demonstrate how to write a number formatter for a different language.
      Numberer class for the English language
      Class Numberer_fr is a number formatter for french.
      Class Numberer_frBE is a number formatter for French as used in Belgium.
       
       
       
       
      Class NumberFormatter defines a method to format a ArrayList of integers as a character string according to a supplied format specification.