Note that there are some explanatory texts on larger screens.

plurals
  1. POXSL-FO: Force Wrap on Table Entries
    primarykey
    data
    text
    <p>I'm having an issue where when I publish my modspecs to pdf (XSL-FO). My tables are having issues, where the content of a cell will overflow its column into the next one. How do I force a break on the text so that a new line is created instead?</p> <p>I can't manually insert zero-space characters since the table entries are programmatically entered. I'm looking for a simple solution that I can just simply add to docbook_pdf.xsl (either as a xsl:param or xsl:attribute)</p> <p><strong>EDIT:</strong> Here is where I'm at currently:</p> <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"&gt; &lt;xsl:import href="urn:docbkx:stylesheet"/&gt; ...(the beginning of my stylesheet for pdf generation, e.g. header and footer content stuff) &lt;xsl:template match="text()"&gt; &lt;xsl:call-template name="intersperse-with-zero-spaces"&gt; &lt;xsl:with-param name="str" select="."/&gt; &lt;/xsl:call-template&gt; &lt;/xsl:template&gt; &lt;xsl:template name="intersperse-with-zero-spaces"&gt; &lt;xsl:param name="str"/&gt; &lt;xsl:variable name="spacechars"&gt; &amp;#x9;&amp;#xA; &amp;#x2000;&amp;#x2001;&amp;#x2002;&amp;#x2003;&amp;#x2004;&amp;#x2005; &amp;#x2006;&amp;#x2007;&amp;#x2008;&amp;#x2009;&amp;#x200A;&amp;#x200B; &lt;/xsl:variable&gt; &lt;xsl:if test="string-length($str) &amp;gt; 0"&gt; &lt;xsl:variable name="c1" select="substring($str, 1, 1)"/&gt; &lt;xsl:variable name="c2" select="substring($str, 2, 1)"/&gt; &lt;xsl:value-of select="$c1"/&gt; &lt;xsl:if test="$c2 != '' and not(contains($spacechars, $c1) or contains($spacechars, $c2))"&gt; &lt;xsl:text&gt;&amp;#x200B;&lt;/xsl:text&gt; &lt;/xsl:if&gt; &lt;xsl:call-template name="intersperse-with-zero-spaces"&gt; &lt;xsl:with-param name="str" select="substring($str, 2)"/&gt; &lt;/xsl:call-template&gt; &lt;/xsl:if&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>With this, the long words are successfully broken up in the table cells! Unfortunately, the side effect is that normal text elsewhere (like in a under sextion X) now breaks up words so that they appear on seperate lines. Is there a way to isolate the above process to just tables?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload