Hi,
You can adapt a bit of code that is used for breaking long URL in ulinks. It parses a text string on any characters that you specify in the parameter named ulink.hyphenate.chars, and at those points it inserts a character specified in the parameter ulink.hyphenate. If you set the former to "." and the latter to the soft hyphen character ­, then such strings will be hyphenated after the period. This simple customization will apply that code to text nodes inside a table cell.

<xsl:param name="ulink.hyphenate.chars">.</xsl:param>
<xsl:param name="ulink.hyphenate">&#xAD;</xsl:param>

<xsl:template match="entry//text()">
 <xsl:call-template name="hyphenate-url">
   <xsl:with-param name="url" select="."/>
 </xsl:call-template>
</xsl:template>

If you examine the FO file, you'll find that after each "." in your table text there is a soft hyphen character, which FOP then uses to hyphenate if needed.

If you want the line to break without showing a dash character, then replace &#xAD; with &#x200B; which is the zero-width space character, which permits a line break at that point. Without the dash, though, it may not be clear to the reader that the string is continued. You could use a backslash instead to indicate continuation if that convention is known to your readers.

These parameter settings will also affect the processing of ulinks, though, so you may want to copy the hyphenate-url template to a new name, customize it using new parameters for your purpose, and call that template instead in your template for table cell text.

Bob Stayton
Sagehill Enterprises
b...@sagehill.net


----- Original Message ----- From: "Dermot O'H" <dermot.ohallo...@gmail.com>
To: <docbook@lists.oasis-open.org>
Sent: Tuesday, February 03, 2009 8:45 AM
Subject: [docbook] Hyphenation within Table Cells



Hi All,

I'm using Docbook 4.4, Docbook XSL 1.73.2, FOP 0.95 to produce PDFs. Some of
my table cells contain long property names such as
"subscriber.send.new.password.encrypted" for example. In some cases these
property names overflow into the next cell as table hyphenation doesn't
apply unless spaces, backslashes or hyphens are detected. Is there a way to specify a period (".") as a hyphenate character in these cases? Or is there
a better approach?

I've tried the solution outlined in
"http://www.nabble.com/Text-overflow-in-table-cells-td21451111.html#a21451111";
but to no avail.

Any pointers would be appreciated. Thanks!

Rgds, Dermot
--
View this message in context: http://www.nabble.com/Hyphenation-within-Table-Cells-tp21807156p21807156.html
Sent from the docbook General mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-h...@lists.oasis-open.org





---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-h...@lists.oasis-open.org

Reply via email to