title: Wrap within table-cell with long word in FOP
body: <p>I have a table in FOP and it is working nicely until I get a very long word. The word then overwrites the cell ending in the table. I tried the wrap-option="wrap" within the table-cell and/or the block of the cell but it doesn't work</p>
  
  <p><strong><code>**Total Edit**</code></strong></p>
  
  <p>since I guess it is to complicated to just show bits here is the complete xsl file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="fo"&gt;
  &lt;xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" /&gt;
  &lt;xsl:param name="tableCell" select="'1.0'" /&gt;
  
  &lt;!-- Globale Variablen START --&gt;
  
  &lt;xsl:param name="tabbgcolor" select="'#EEEEEE'" /&gt;
  
  
  
  &lt;!-- Globale Variablen ENDE --&gt;
  
  &lt;xsl:template match="/datasheet"&gt;
      &lt;fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fn="http://www.w3.org/2005/xpath-functions"&gt;
          &lt;fo:layout-master-set&gt;
              &lt;fo:simple-page-master page-height="29.7cm" page-width="21cm" margin-top="1cm" margin-bottom="1cm" margin-left="1.5cm" margin-right="1.5cm" master-name="first"&gt;
                  &lt;fo:region-body margin-top="20mm" margin-bottom="20mm" /&gt;
                  &lt;fo:region-before extent="15mm" /&gt;
                  &lt;fo:region-after extent="15mcm" /&gt;
              &lt;/fo:simple-page-master&gt;
              &lt;fo:simple-page-master master-name="new" margin-right="1.0cm" margin-left="1.0cm" margin-bottom="1cm" margin-top="1cm" page-height="21cm" page-width="29.7cm"&gt;
                  &lt;fo:region-body margin-top="30mm" margin-bottom="20mm" /&gt;
                  &lt;fo:region-before extent="30mm" /&gt;
                  &lt;fo:region-after extent="15mm" /&gt;
              &lt;/fo:simple-page-master&gt;
          &lt;/fo:layout-master-set&gt;
  
  
  
          &lt;fo:page-sequence language="de" country="DE" master-reference="new" initial-page-number="1"&gt;
  
              &lt;fo:static-content flow-name="xsl-region-before"&gt;
                  &lt;fo:block text-align="center" font-size="12pt" padding="5pt" font-weight="bold"&gt;
                      &lt;xsl:value-of select="title" /&gt;
                  &lt;/fo:block&gt;
                  &lt;fo:block text-align="right" font-size="12pt" padding="5pt" font-weight="bold"&gt;
                      &lt;xsl:value-of select="date" /&gt;
                  &lt;/fo:block&gt;
                  &lt;fo:block text-align="right" font-size="12pt" padding="0pt" font-weight="bold"&gt;
                      &lt;xsl:value-of select="time" /&gt;
                  &lt;/fo:block&gt;
                  &lt;fo:block&gt;
                      &lt;fo:leader leader-length="100%" leader-pattern="rule" rule-thickness="2pt" color="black" /&gt;
                  &lt;/fo:block&gt;
              &lt;/fo:static-content&gt;
  
              &lt;fo:static-content flow-name="xsl-region-after"&gt;
                  &lt;fo:block text-align="center"&gt;
                      Seite
                      &lt;fo:page-number /&gt;
                      von
                      &lt;fo:page-number-citation ref-id="TheVeryLastPage" /&gt;
                  &lt;/fo:block&gt;
              &lt;/fo:static-content&gt;
  
  
  
  
  
              &lt;fo:flow flow-name="xsl-region-body"&gt;
  
  
  
                  &lt;fo:block&gt;
                      &lt;fo:leader /&gt;
                  &lt;/fo:block&gt;
                  &lt;fo:block&gt;
                      &lt;fo:leader /&gt;
                  &lt;/fo:block&gt;
                  &lt;fo:block&gt;
                      &lt;fo:leader /&gt;
                  &lt;/fo:block&gt;
  
  
                  &lt;fo:block font-weight="bold" padding="5pt" padding-top="25pt"&gt;
                      Jahre &lt;xsl:value-of select="fromYear" /&gt; bis &lt;xsl:value-of select="toYear" /&gt;
                  &lt;/fo:block&gt;
  
                  &lt;fo:block text-align="center"&gt;
                      &lt;xsl:choose&gt;
                          &lt;xsl:when test="dataList != ''"&gt;
                              &lt;fo:table table-layout="fixed" width="100%" border-style="solide" border-width="1pt"&gt;
                                  &lt;fo:table-column column-width="25%" border-style="solid" border-width="1pt" /&gt;
                                  &lt;fo:table-column column-width="25%" border-style="solid" border-width="1pt" /&gt;
                                  &lt;fo:table-column column-width="25%" border-style="solid" border-width="1pt" /&gt;
                                  &lt;fo:table-column column-width="25%" border-style="solid" border-width="1pt" /&gt;
  
  
  
                                  &lt;fo:table-header&gt;
                                      &lt;fo:table-row&gt;
                                          &lt;fo:table-cell border-style="solid" font-weight="bold" border-width="0pt"&gt;
                                              &lt;fo:block&gt;
                                                  Cell1
                                              &lt;/fo:block&gt;
                                          &lt;/fo:table-cell&gt;
                                          &lt;fo:table-cell border-style="solid" font-weight="bold" border-width="0pt"&gt;
                                              &lt;fo:block&gt;
                                                  Cell2
                                              &lt;/fo:block&gt;
                                          &lt;/fo:table-cell&gt;
                                          &lt;fo:table-cell border-style="solid" font-weight="bold" border-width="0pt"&gt;
                                              &lt;fo:block&gt;
                                                  Cell3
                                              &lt;/fo:block&gt;
                                          &lt;/fo:table-cell&gt;
                                          &lt;fo:table-cell border-style="solid" font-weight="bold" border-width="0pt"&gt;
                                              &lt;fo:block&gt;
                                                  Cell4
                                              &lt;/fo:block&gt;
                                          &lt;/fo:table-cell&gt;
  
                                      &lt;/fo:table-row&gt;
                                  &lt;/fo:table-header&gt;
  
                                  &lt;fo:table-body&gt;
                                      &lt;xsl:for-each select="dataList"&gt; 
                                          &lt;fo:table-row&gt;
                                              &lt;fo:table-cell padding="5pt" border-style="solid" border-width="1pt"&gt;
                                                  &lt;fo:block text-align="left"&gt;
                                                      &lt;xsl:value-of select="data1" /&gt;
                                                  &lt;/fo:block&gt;
                                              &lt;/fo:table-cell&gt;
                                              &lt;fo:table-cell padding="5pt" border-style="solid" border-width="1pt"&gt;
                                                  &lt;fo:block text-align="left"&gt;
                                                      &lt;xsl:value-of select="data2" /&gt;
                                                  &lt;/fo:block&gt;
                                              &lt;/fo:table-cell&gt;
                                              &lt;fo:table-cell padding="5pt" border-style="solid" border-width="1pt"&gt;
                                                  &lt;fo:block text-align="left"&gt;
                                                      &lt;xsl:value-of select="data3" /&gt;
                                                  &lt;/fo:block&gt;
                                              &lt;/fo:table-cell&gt;
                                              &lt;fo:table-cell padding="5pt" border-style="solid" border-width="1pt"&gt;
                                                  &lt;fo:block text-align="left"&gt;
                                                      &lt;xsl:call-template name="intersperse-with-zero-spaces"&gt;
  &lt;xsl:with-param name="str" select="data4"/&gt;
  &lt;/xsl:call-template&gt;
                                                  &lt;/fo:block&gt;
                                              &lt;/fo:table-cell&gt;
  
                                          &lt;/fo:table-row&gt;
                                      &lt;/xsl:for-each&gt;  
                                  &lt;/fo:table-body&gt;
  
                              &lt;/fo:table&gt;
                          &lt;/xsl:when&gt;
                          &lt;xsl:otherwise&gt;
                              &lt;fo:block padding="6cm" text-align="center" font-weight="bold" font-size="16pt"&gt;No data.
                              &lt;/fo:block&gt;
                          &lt;/xsl:otherwise&gt;
                      &lt;/xsl:choose&gt;
                  &lt;/fo:block&gt;
  
  
                  &lt;fo:block id="TheVeryLastPage"&gt;
                  &lt;/fo:block&gt;
              &lt;/fo:flow&gt;
          &lt;/fo:page-sequence&gt;
  
          &lt;!-- ___________________________________________________________________________________________________________ --&gt;
  
  
  
  
  
      &lt;/fo:root&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>The cell data4 is the one with the problems.... like 255 digits or characters at once with no hyphen oder space. </p>
  
  <p>The input is from a database but could be like:</p>
  
  <pre><code> &lt;datasheet&gt;
     &lt;dataList&gt;
       &lt;data1&gt;intro&lt;/data1&gt;
       &lt;data2&gt;section&lt;/data2&gt;
       &lt;data3&gt;cutters&lt;/data3&gt;
       &lt;data4&gt;743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348743576746876357467569384657654687465874638563465873487435767468763574675693846576546874658746385634658734874357674687635746756938465765468746587463856346587348&lt;/data4&gt;
  
     &lt;/dataList&gt;
   &lt;/datasheet&gt;
  </code></pre>
  
  <p>the result should be a table like:</p>
  
  <pre><code>|cell1  |cell2  |cell3  |cell4  |
  _________________________________
  |intro  |section|cutters|7435767|
                          |4687635|
                          |7467569|
                          |3846576|
  _________________________________
  </code></pre>
  
  <p>and so on in cell 4</p>
  
  <p><strong>Now the above works</strong></p>