axf:number-transform
(Auszug aus "XSL-FO ― Die Referenz" von Manuel Montero Pineda & Steffen Herkert, 2016, dpunkt.verlag)
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Category Text Transformation
Converts the number sequence in the character string. [no-LT]
Value: | none | kansuji | kansuji-if-vertical | <list-style-type> | <string> |
Initial: | none |
Applies to: | all block-level and inline-level formatting objects |
Inherited: | yes |
Percentages: | N/A |
Values have the following meanings.
none | Do nothing. |
kansuji | Converts the contained number sequence into Japanese numerals. The details of the Japanese numeral format can be specified by axf:kansuji-style, axf:kansuji-letter and axf:kansuji-grouping-letter. |
kansuji-if-vertical | Only with the vertical writing, such as writing-mode="tb-rl", axf:number-transform="kansuji" is applied. Nothing is changed when it's not the vertical writing. |
<list-style-type> | Among the list-style-type defined by CSS, the number related types which can be specified are <algorithmic>, <numeric>, <alphabetic>, <symbolic>, <non-repeating>. Convertible digit numbers may differ depending on list-style-type. Too long number sequence cannot be converted. |
<string> | When a character string is specified, the behavior is same as when the character string is specified by format. |
A number sequence (number) here indicates character strings of the following forms.
number ::= digits digits ::= [0-9]+
When it is simultaneously specified with text-transform or axf:text-replace, axf:number-transform is evaluated previously.
XSL-FO sample:
| <fo:root xml:lang="ja" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:cpfo="http://www.compart.net/xmlns/cpfo" xmlns:svg="http://www.w3.org/2000/svg" xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions"> | |
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| Antenna House, Inc. | |
| ||
| </fo:block> | |
| ||
| ||
| </fo:block> | |
| ||
| ||
| ||
| ||
| カウンタスタイルの設定例 | |
| </fo:block> | |
| </fo:block> | |
| ||
| <fo:block> | |
| axf:counter-style により独自のカウンタスタイルを定義できます。name でカウンタスタイルの名前、system でカウンタシステムの種類、symbols でカウンタシンボルを指定します。name で指定した名前は list-style-type や axf:number-transform などで利用可能です。axf:counter-style 拡張要素は、fo:declarations の直下に配置できます。また、 | |
| ||
| ||
| Predefined Counter Styles | |
| ||
| </fo:inline> | |
| および | |
| ||
| ||
| 7. Complex Predefined Counter Styles | |
| ||
| </fo:inline> | |
| で定義されているスタイルを利用できます。詳細はオンラインマニュアルの「 | |
| ||
| ||
| axf:counter-style | |
| ||
| </fo:inline> | |
| 」をご参照ください。カウンタスタイルの設定は AH Formatter V6.3 から利用いただけます。 | |
| </fo:block> | |
| </fo:block> | |
| ||
| このサンプルでは、一部を除き | |
| ||
| "One:1, Two:2, Three:3, Four:4, Five:5, Six:6" | |
| </fo:inline> | |
| の文字列中の数字が変換されるように axf:number-transform の指定と axf:counter-style で定義した name を設定します。変換される数字は赤字にしています。また、ページ番号 fo:page-number の形式が、(1)、(2) ... になるよう fo:page-sequence の format へも axf:counter-style で定義した name を設定しています。 | |
| </fo:block> | |
| ||
| system="cyclic" symbols="a b c" | |
| </fo:block> | |
| ||
| 文字列内の数字列が a, b, c, a, b, c ... と繰り返すよう変換されます。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="numeric" symbols="a b c" | |
| </fo:block> | |
| ||
| 最初のシンボル a を 0 とみなすため、b から始まります。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="alphabetic" symbols="a b c" | |
| </fo:block> | |
| ||
| 文字列内の数字列が a, b, c, aa, ab, ac, ba, bb, bc, ... の順で変換されます。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="symbolic" symbols="a b c" | |
| </fo:block> | |
| ||
| 文字列内の数字列が a, b, c, aa, bb, cc, aaa, bbb, ccc, ... の順で変換されます。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="additive" additive-symbols="5 v,1 i" | |
| </fo:block> | |
| ||
| 文字列内の数字列が 1 を i、5 を v として変換されます。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="fixed" symbols="a b c" | |
| </fo:block> | |
| ||
| 文字列内の数字列を a, b, c まで変換、以後は数字列のまま表示します。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| ||
| system="extends decimal" pad="2 '0'" | |
| </fo:block> | |
| ||
| pad で短い桁に対するパディングを指定します。 2桁まで 01, 02, 03, ... の順で表示します。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="fixed" symbols="a b c" range="1 3" fallback="cjk-decimal" | |
| </fo:block> | |
| ||
| range でスタイル適用範囲を指定、fallback で適用範囲外のフォールバックスタイルを指定します。 1~3 の間は a, b, c のスタイルが適用されます。以降は Predefined Counter Styles 定義の cjk-decimal が適用され表示されます。 | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| system="extends decimal" negative="[ ]" | |
| </fo:block> | |
| ||
| negative で負の値に対する前置後置文字列を指定します。 負の値に前置'['、後置']' が適用され表示されます。 | |
| </fo:block> | |
| ||
| Negative two: | |
| ||
| -2 | |
| </fo:inline> | |
| , Negative one: | |
| ||
| -1 | |
| </fo:inline> | |
| , Zero: | |
| ||
| 0 | |
| </fo:inline> | |
| , One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| Predefined Counter Styles、7. Complex Predefined Counter Styles | |
| </fo:block> | |
| ||
| 定義済み Predefined Counter Styles および 7. Complex Predefined Counter Styles のスタイルを指定した例です。 | |
| </fo:block> | |
| ||
| circled-decimal | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| filled-circled-decimal | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| fullwidth-upper-alpha | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| lower-greek | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| japanese-informal | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| ||
| japanese-formal | |
| </fo:block> | |
| ||
| One: | |
| ||
| 1 | |
| </fo:inline> | |
| , Two: | |
| ||
| 2 | |
| </fo:inline> | |
| , Three: | |
| ||
| 3 | |
| </fo:inline> | |
| , Four: | |
| ||
| 4 | |
| </fo:inline> | |
| , Five: | |
| ||
| 5 | |
| </fo:inline> | |
| , Six: | |
| ||
| 6 | |
| </fo:inline> | |
| </fo:block> | |
| </fo:flow> | |
| ||
| </fo:root> |
Output:
page 2
Tipp der data2type-Redaktion: Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: |