<axf:counter-style>

(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

With AH Formatter V6.3, unique counter style can be defined. For details about the CSS specification, please see CSS Counter Styles Level 3. This function is not available with AH Formatter V6.3 Lite. V6.3no-LT

Common Usage: Defining custom counter styles. This element does not generate area.
Areas:None.
Constraints:

<!ELEMENT axf:counter-style EMPTY> <!ATTLIST axf:counter-style name CDATA #REQUIRED> <!ATTLIST axf:counter-style system CDATA "symbolic"> <!ATTLIST axf:counter-style negative CDATA "-"> <!ATTLIST axf:counter-style prefix CDATA ""> <!ATTLIST axf:counter-style suffix CDATA ", "> <!ATTLIST axf:counter-style range CDATA "auto"> <!ATTLIST axf:counter-style pad CDATA "0 ''"> <!ATTLIST axf:counter-style fallback CDATA "decimal"> <!ATTLIST axf:counter-style symbols CDATA #IMPLIED> <!ATTLIST axf:counter-style additive-symbols CDATA #IMPLIED>

The <axf:counter-style> element can be placed directly under <fo:declarations>.
Contents:EMPTY
Examples:

<fo:declarations> <axf:counter-style name="trinary" system="numeric" symbols="'0' '1' '2'" suffix="') '"/> </fo:declarations>

The following properties can be specified to <axf:counter-style> / @counter-style.

CAUTION: Strings can only be specified for <symbol>. Please note url() cannot be specified.

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.

カウンタスタイルの設定例

axf:counter-style により独自のカウンタスタイルを定義できます。name でカウンタスタイルの名前、system でカウンタシステムの種類、symbols でカウンタシンボルを指定します。name で指定した名前は list-style-type や axf:number-transform などで利用可能です。axf:counter-style 拡張要素は、fo:declarations の直下に配置できます。また、

Predefined Counter Styles

および

7. Complex Predefined Counter Styles

で定義されているスタイルを利用できます。詳細はオンラインマニュアルの「

axf:counter-style

」をご参照ください。カウンタスタイルの設定は AH Formatter V6.3 から利用いただけます。

このサンプルでは、一部を除き

"One:1, Two:2, Three:3, Four:4, Five:5, Six:6"

の文字列中の数字が変換されるように axf:number-transform の指定と axf:counter-style で定義した name を設定します。変換される数字は赤字にしています。また、ページ番号 fo:page-number の形式が、(1)、(2) ... になるよう fo:page-sequenceformat へも axf:counter-style で定義した name を設定しています。

system="cyclic" symbols="a b c"

文字列内の数字列が a, b, c, a, b, c ... と繰り返すよう変換されます。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="numeric" symbols="a b c"

最初のシンボル a を 0 とみなすため、b から始まります。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="alphabetic" symbols="a b c"

文字列内の数字列が a, b, c, aa, ab, ac, ba, bb, bc, ... の順で変換されます。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="symbolic" symbols="a b c"

文字列内の数字列が a, b, c, aa, bb, cc, aaa, bbb, ccc, ... の順で変換されます。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="additive" additive-symbols="5 v,1 i"

文字列内の数字列が 1 を i、5 を v として変換されます。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="fixed" symbols="a b c"

文字列内の数字列を a, b, c まで変換、以後は数字列のまま表示します。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="extends decimal" pad="2 '0'"

pad で短い桁に対するパディングを指定します。 2桁まで 01, 02, 03, ... の順で表示します。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="fixed" symbols="a b c" range="1 3" fallback="cjk-decimal"

range でスタイル適用範囲を指定、fallback で適用範囲外のフォールバックスタイルを指定します。 1~3 の間は a, b, c のスタイルが適用されます。以降は Predefined Counter Styles 定義の cjk-decimal が適用され表示されます。

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

system="extends decimal" negative="[ ]"

negative で負の値に対する前置後置文字列を指定します。 負の値に前置'['、後置']' が適用され表示されます。

Negative two:

-2

, Negative one:

-1

, Zero:

0

, One:

1

, Two:

2

, Three:

3

Predefined Counter Styles、7. Complex Predefined Counter Styles

定義済み Predefined Counter Styles および 7. Complex Predefined Counter Styles のスタイルを指定した例です。

circled-decimal

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

filled-circled-decimal

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

fullwidth-upper-alpha

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

lower-greek

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

japanese-informal

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

japanese-formal

One:

1

, Two:

2

, Three:

3

, Four:

4

, Five:

5

, Six:

6

Download der Beispiele

Output:

page 2

Tipp der data2type-Redaktion:
Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: