axf:text-replace
(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
Replaces the character strings. [CSS3-GCPM] Character substitution
Value: | none | [ <string> <string> ]+ |
Initial: | none |
Applies to: | all block-level and inline-level formatting objects |
Inherited: | no |
Percentages: | N/A |
Values have the following meanings.
none | Do nothing. |
<string> <string> | The first pair of character strings is replaced by the latter character strings. You have to specify a character string by a pair. It is not replaced when character strings are odd pieces or the first character string is empty. White space characters will be replaced after being processed by white-space-treatment, etc. |
When it is simultaneously specified with text-transform or axf:number-transform, axf:text-replace will be evaluated at the end.
XSL-FO sample:
| <fo:root xml:lang="en" 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> | |
| ||
| ||
| ||
| ||
| Character string substitution | |
| </fo:block> | |
| </fo:block> | |
| ||
| Character string is substituted by using axf:text-replace. Character strings are designated as a pair. The first character string of a pair is replaced entirely with the latter character string. When you want to substitute the character strings including a space such as 'Antenna House', please enclose them with single quotation marks. | |
| </fo:block> | |
| ||
| <fo:block> | |
| Original character string | |
| </fo:block> | |
| ||
| sample. 1999-2008, sample. sample. Antenna House, sample. sample. Antenna House, sample. | |
| </fo:block> | |
| ||
| Specify axf:text-replace="2008 2010" | |
| </fo:block> | |
| ||
| sample. 1999-2008, sample. sample. Antenna House, sample. sample. Antenna House, sample. | |
| </fo:block> | |
| ||
| Specify axf:text-replace="2008 2010 Antenna AAA" | |
| </fo:block> | |
| ||
| sample. 1999-2008, sample. sample. Antenna House, sample. sample. Antenna House, sample. | |
| </fo:block> | |
| ||
| Specify axf:text-replace="2008 2010" 'Antenna House' AAA" | |
| </fo:block> | |
| ||
| sample. 1999-2008, sample. sample. Antenna House, sample. sample. Antenna House, sample. | |
| </fo:block> | |
| </fo:block> | |
| </fo:flow> | |
| ||
| </fo:root> |
Output:
Tipp der data2type-Redaktion: Zum Thema XSL-FO bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an: |