title: xsl fo render Empty Table Structure when no Data is available in table Body
body: <p>I am using XSL FO to transform XML data from a file into Tables rendered as PDF document. I am being asked to render empty table structure if no data came in the XML - leaving the table body empty. </p>
  
  <p>I tried the below code </p>
  
  <pre><code>        &lt;!-- Addresses --&gt;
              &lt;fo:table border="1px solid black" table-layout="fixed" width="100%"&gt;
              &lt;fo:table-column column-width="2in"/&gt;
              &lt;fo:table-column column-width="2in"/&gt;
              &lt;fo:table-column column-width="2.5in"/&gt;
              &lt;fo:table-column column-width="2.5in"/&gt;             
              &lt;fo:table-column column-width="2in"/&gt;
              &lt;fo:table-header&gt;
                  &lt;fo:table-row&gt;
                      &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="12pt" font-weight="bold" number-columns-spanned="5" background-color= "#B6B6B4"&gt;&lt;fo:block&gt;Addresses&lt;/fo:block&gt;&lt;/fo:table-cell&gt;                                           
                  &lt;/fo:table-row&gt;
                          &lt;fo:table-row&gt;
                          &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="10pt" font-weight="bold"&gt;
                                  &lt;fo:block&gt; Address Type &lt;/fo:block&gt;
                              &lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="10pt" font-weight="bold"&gt;
                                  &lt;fo:block&gt; Fields&lt;/fo:block&gt;
                              &lt;/fo:table-cell&gt;                                
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="10pt" font-weight="bold"&gt;
                                  &lt;fo:block&gt; Values &lt;/fo:block&gt;
                              &lt;/fo:table-cell&gt;                                                
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="10pt" font-weight="bold"&gt;
                                  &lt;fo:block&gt; Data Source&lt;/fo:block&gt;
                              &lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="10pt" font-weight="bold"&gt;
                                  &lt;fo:block&gt; DMC Doc Link&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:if test="core/clientMembers/address"&gt;
                              &lt;xsl:apply-templates select="core/clientMembers/address"/&gt;
                          &lt;/xsl:if&gt;                               
                          &lt;xsl:if test="not(core/clientMembers/address)"&gt;
                              &lt;fo:table-row&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="9pt"&gt;&lt;fo:block&gt;Primary Address&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                           &lt;/fo:table-row&gt;                                
                           &lt;fo:table-row&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="9pt"&gt;&lt;fo:block&gt;Incorporated Address&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;/fo:table-row&gt;
                              &lt;fo:table-row&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="9pt"&gt;&lt;fo:block&gt;Registered Address&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;/fo:table-row&gt;
                              &lt;fo:table-row&gt;
                              &lt;fo:table-cell border="0.1pt solid black" text-align="left" font-size="9pt"&gt;&lt;fo:block&gt;Mailing Address&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;fo:table-cell border="0.1pt solid black"&gt;&lt;fo:block white-space-treatment="preserve"&gt;&lt;fo:leader /&gt;&lt;/fo:block&gt;&lt;/fo:table-cell&gt;
                              &lt;/fo:table-row&gt;                                                                                                 
                          &lt;/xsl:if&gt;
                      &lt;/fo:table-body&gt;
                  &lt;/fo:table&gt;
  </code></pre>
  
  <p>However this piece of code is not working as expected. 
  Could the experts here pls pls pls advise if there is a way to achieve the desired behavior in XSL FO ???
  "core/clientMain/coverage" is xsl template . </p>