I need some help with a template in xsl-fo to generate a pdf from xml data.
My issue is that I need to make a table that gets only one item(node) of many.
For exaple I might have an xml that looks like this
<CollectionOfItems>
<items>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
</items>
<items>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
</items>
</items>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
<title ID="someid" location="somelocation" price="someprice"/>
</items>
</CollectionOfItems>
Each "items" nodes need to be in a separate table...so I made a table in xsl-fo table that looks like this
<fo:table width="100%" border-style="outset" border-width="2pt" background-repeat="no-repeat">
<fo:table-column/>
<fo:table-column/>
<fo:table-column/>
<fo:table-body>
<xsl:for-each select="/Items/item/DataModification/Form/Tab/ModControl/Value/CompetenceConfig/Chapters/Chapter">
<xsl:variable name="Chapter" select="."/>
<fo:table-row>
<fo:table-cell border-style="inset" border-width="2pt" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block>
<xsl:value-of select="@ID"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="inset" border-width="2pt" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block>
<xsl:value-of select="@location"/>
</fo:block>
</fo:table-cell>
<fo:table-cell border-style="inset" border-width="2pt" padding="2pt" background-repeat="repeat" display-align="center">
<fo:block>
<xsl:value-of select="@price"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:for-each>
</fo:table-body>
This kinda works but instead of getting for example one "items" node with the items inside for each table I get 3 tables with the 3 "items" nodes that look the same. How can I show the first "nodes" item in the first table, the second "items" node in the second table and so on? I would really appreciate any help on this. I have been trying to solve this for days and I am new to xsl-fo.
Thanks a lot!
