• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubt in XSL:FO

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am a new bee to XSL:FO , I have a requirement where in have to print addresses adjacent to each other in a PDF like the one below :

<table>
<tr>
<td>
Rakesh
AH4, djhdfj
Skdfjsfjk, sdjfhskdf
Sdjfsdkfj,
Chennai
</td>
<td>
Ramesh,
Wdjflsdk,sdflsdf,
Sdfksdl, wehksd
Sdkjfskldf,
Chennai
</td>
</tr>
<tr>
<td>
Vasanth
AK90, sdfjhdfjk,
Dfigjdflgk, dlfkgdfkg,
Chennai
</td>
<td>
Satish,
Sdjfhsdf, sdfjsdklf,
Sdofjsdf,
Chennai
</td>
</tr>
</table>

In my XML file I have each of these in a root note, the structure is as follows:

<candidate>
<name>rakesh</name>
<addressline1> AH4, djhdfj</addressline1>
<addressline2> Skdfjsfjk, sdjfhskdf</addressline2>
<addressline3> Sdjfsdkfj,</addressline3>
<addressline4> Chennai</addressline4>
</candidate>

So each of the candidate will have something like this, now in XSL:FO I call the apply-template method for candidate, the code is as follows , I have put snippets of my XSL:FO here:

<fo:table text-align="center" border-spacing="3pt">

<fo:table-column column-number="1" />
<fo:table-column column-number="2" />
<fo:table-column column-number="3" />
<fo:table-column column-number="4" />
<fo:table-column column-number="5" />
<fo:table-column column-number="6" />
<fo:table-column column-number="7" />
<fo:table-column column-number="8" />
<fo:table-column column-number="9" />
<fo:table-column column-number="10" />
<fo:table-column column-number="11" />
<fo:table-column column-number="12" />

<fo:table-body>
<xsl:apply-templates select=" candidate "/>
</fo:table-body>


<xsl:template match=" candidate ">
<fo:table-cell number-rows-spanned="2" number-columns-spanned="6" border="1pt solid black">
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select=" name "/></fo:block>
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="addressline1"/> </fo:block>
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="addressline2"/> fo:block>
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="addressline3"/></fo:block>
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="addressline4"/></fo:block>
<fo:block text-align="left" white-space-collapse="false" white-space-treatment="preserve"><xsl:value-of select="addressline5"/></fo:block>

</fo:table-cell>
</xsl:template>


Now if there are more number of candidates, this XSL:FO is giving a blank page as the first page and then the rest is fine.
Could I know why this is happening???

Am I using this number-rows-spanned="2" in a wrong way.

My Assumption : since I have 12 columns, I put the first candidate in the first 6 columns and then after its done the apply template method will be executed again, so since there are another 6 columns left free the next candidate would be placed there, this logic worked fine for say 10 candidates suppose I have around 100 candidates it still works but there is a initial blank page???
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic