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
Hi there,
if I have followed XML entity
<contactperson>
Prename Surname
Telephone Number
</contactperson>
and the associated XSL Snippet
<fo:table-cell>
<fo:block text-align="left"
font-size="11pt"
font-family="Courier"
line-height="14pt">
<xsl:apply-templates select="contactperson"/>
</fo:block>
</fo:table-cell>
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?
Greets
kirashet
if I have followed XML entity
<contactperson>
Prename Surname
Telephone Number
</contactperson>
and the associated XSL Snippet
<fo:table-cell>
<fo:block text-align="left"
font-size="11pt"
font-family="Courier"
line-height="14pt">
<xsl:apply-templates select="contactperson"/>
</fo:block>
</fo:table-cell>
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?
Greets
kirashet
-
- Posts: 35
- Joined: Fri Jun 03, 2005 11:00 am
Have you tried wrap-option="wrap"?
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"
and
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"
wrap-option="wrap"
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.
</fo:block>
Hope this helps
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"
and
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"
wrap-option="wrap"
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.
</fo:block>
Hope this helps
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service