Johan Andersson wrote:
I'm trying to transform the XML snippet below to a FO table with a width of 3 columns. The list contain a maximum of 9 elements. Each cell should contain an image and its description. I would appreciate any advice on how to implement such a transformation.

XSLT questions usually get better responses on the XSL list http://www.mulberrytech.com/xsl/xsl-list/ You problem is actualy a FAQ, the soution is called "grouping by position" (google for details).

Hint:
  <xsl:template match="list">
    <fo:table ...>
      < ... column decl ... >
      <fo:table-body>
         <xsl:apply-templates select="
           list-label[position() mod 3=1]"/>
      </fo:table-body>
    </fo:table>
  </xsl:template>

  <xsl:template match="list-label">
    <fo:table-row>
      <xsl:for-each select=".|following-sibling::list-label
                   [position()<3]">
         <fo:table-cell>
           <fo:block>
             <fo:external-graphics src="."/>
           </fo:block>
           <fo:block>
             <xsl:apply-templates select="following-sibling::
                list-text[1]"/>
           </fo:block>
         </fo:table-cell>
      </xsl:for-each>
    <fo:table-row>
 ...


J.Pietschmann

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to