title: problem with deciding whether to or not to print heading on last page : xsl-fo
body: <p>Hi
  i have a problem with pdf generation using xsl-fo. The pdf print invoice lines in each page.
  So there is a conditional checking at the last page to determine whether to or not to print the heading on last page. If there is one or more lines in the last page then there should be a heading. Otherwise not.</p>
  
  <p>currently it is done using the logic below</p>
  
  <pre><code>if(total number of invoice lines== preceding::number of invoice lines+1)
  {
   call an empty marker
  }
  else
  {
  call a marker which prints the heading
  }
  </code></pre>
  
  <p>when preceding number of invoice lines+1 is equal to total number of invoice lines, heading will not be displayed. The logic holds true when there is no more lines to be displayed in the last page or when the number of lines in last page is greater than one.</p>
  
  <p>Now the problem is,</p>
  
  <p>the above logic fails when there is only one line in the last page.</p>
  
  <p>The condition if(total number of invoice lines==preceeding::number of invoice lines+1) will become true and an empty marker will be called which will not display the heading. I need to display the heading even if there is only one invoice line in the last page.</p>
  
  <p>Is there any way to solve this problem?</p>
  
  <p>Any help is appreciated. </p>
  
  <p>-Arun</p>
  
  <p><strong>screenshots:</strong></p>
  
  <p>The following screen shots show a two page invoice.</p>
  
  <p>following screen shot shows last page with two invoice lines. When there are only two lines in the last page, the logic holds.</p>
  
  <p><a href="http://img97.imageshack.us/i/85089628.jpg" rel="nofollow">http://img97.imageshack.us/i/85089628.jpg</a></p>
  
  <p>But when there is only one line in the last page the conditional check 
  if(total number of invoice lines==preceeding::number of invoice lines+1)  become true and the heading is not displayed.</p>
  
  <p><a href="http://img222.imageshack.us/i/49057497.jpg" rel="nofollow">http://img222.imageshack.us/i/49057497.jpg</a></p>