Wrapping text

Here should go questions about transforming XML with XSLT and FOP.
Posts: 4
Joined: Fri Nov 18, 2005 11:37 am

Wrapping text

Post by kirashet » Fri Nov 18, 2005 3:16 pm

Hi there,

if I have followed XML entity

Prename Surname
Telephone Number

and the associated XSL Snippet

<fo:block text-align="left"
<xsl:apply-templates select="contactperson"/>

it's in the resulted PDF like that: "Prename Surname Telephone Number".

Bud I'd like to have a wrap after "Prename Surname".

How to handle this?
Any ideas?


Posts: 35
Joined: Fri Jun 03, 2005 11:00 am

Have you tried wrap-option="wrap"?

Post by Franck » Mon Jan 16, 2006 1:56 pm

I am still an FO newby, but with apache FOP 0.90:

I have found that wrap-option="wrap" does the trick. It also seem that wrap is the default, so I don't actually need to specify it.

Look also at linefeed-treatment="preserve" | "ignore"


hyphenate="false" or "true".

There is currently a problem with combining linefeed-treatment="preserve" and hyphenate="true", but I am sure they'll fix it soon.

<fo:block language="en"
linefeed-treatment="preserve" white-space-collapse="false"
hyphenate="false" hyphenation-push-character-count="2"
hyphenation-remain-character-count="2" space-after.optimum="3pt">
TELL ME, O MUSE, of that ingenious hero who travelled far and wide after he had sacked the famous town of Troy.
Many cities did he visit, and many were the nations with whose manners and customs he was acquainted; moreover he suffered much by sea while trying to save his own life and bring his men safely home; but do what he might he could not save his men, for they perished through their own sheer folly in eating the cattle of the Sun-god Hyperion; so the god prevented them from ever reaching home.
Tell me, too, about all these things, O daughter of Jove, from whatsoever source you may know them.

Hope this helps

Post Reply