xsl:fo different colors/fonts in one block

Ya. picture Ya. · Jan 24, 2013 · Viewed 16.3k times · Source

Suppose I have an xsl:fo block:

<fo:block>one two three</fo:block>

Can I make "three" a different color than "one" and "two"? Note: I'd rather NOT use a table for this.

Answer

Mads Hansen picture Mads Hansen · Jan 24, 2013

You can us an <fo:inline> element.

The fo:inline formatting object is commonly used for formatting a portion of text with a background or enclosing it in a border.

For example, in order to make the word "three" red:

<fo:block>one two <fo:inline color="#FF0000">three</fo:inline></fo:block>