You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Henriksen Niels Kristoffer <ni...@wmdata.com> on 2002/10/11 10:34:23 UTC

RE: Printing 4x2 stickers per page - solved!

Pitchmann wrote:

You misunderstood quite a lot. Get a good XSLT book and *read it*, the
XSL list archive and the FAQ has recommendations.

I guessed so... I am under my way with Michael Kay's authoritative book and
chaps. 1 - 5 of the W3C XSL ver. 1.0 recommendation (15.10.2001), which I
will recommend.

Also, the problem has been solved, warm thanks to all who cared.

In particular Pitchmann wrote:

...

Try

<xsl:template match="List">
   <fo:table table-layout="fixed">
     <fo:table-column column-width="105mm"/>
     <fo:table-column column-width="105mm"/>
     <fo:table-body>
       <xsl:for-each select="ListItem[position() mod 2 = 1]">
         <fo:table-row height="71mm">
           <fo:table-cell>
            <fo:block>
               <xsl:apply-templates select="*"/>
            </fo:block>
           </fo:table-cell>			
           <fo:table-cell>
            <fo:block>
               <xsl:apply-templates select="following-sibling[1]/*"/>
            </fo:block>
           </fo:table-cell>			
         </fo:table-row>
       </xsl:for-each>
     </fo:table-body>
   </fo:table>
</xsl:template>

You might have to add some special handling in case of an odd number
of ListItems, i.e. following-sibling[1] is the empty set. I'd also recomment
to restrict the numbers of person data printed in a cell by using
               <xsl:apply-templates select="*[position() < 5"/>
or something, FOP will grow the row hight if there is too much data.

This is not exactly what I've come up with, but this one was the crucial
hint. Thanks!

Best regards & wishes for a nice weekend

Niels.