Below is something we use as part of a much more involved stylesheet. Although 
looking at it now it's not the most efficient piece of code as it loops through 
the same nodes several times. (We use it to break output into groups of five 
columns and know we'll never have more than 3 or 4 groups, so we didn't need to 
worry about running through the same nodes a few extra times.) 

I think for efficiency and straighforwardness, the Steve Tinney example from 
the link in the previous post is probably the best way to go. 
(http://www.dpawson.co.uk/xsl/sect2/N4486.html#d4085e94)

-matt


[...]
<fo:table-body>
       
  <xsl:for-each select="customerPF">
    <xsl:if test="(position()-1) mod 3 = 0">

        <xsl:call-template name="new-row">
         <xsl:with-param name="row-num" select="position() - 1" />
        </xsl:call-template>

    </xsl:if>
   <fo:table-cell><fo:block><xsl:value-of 
select="position()"/></fo:block></fo:table-cell>
  </xsl:for-each>
 
</fo:table-body>
[...]


<xsl:template name="new-row">
 <xsl:param name="row-num"/>
 
   <fo:table-row>

    <xsl:for-each select="../customerPF">
     <xsl:if test="$row-num &lt; position()">
      <xsl:if test="$row-num+4 &gt; position()">
        <fo:table-cell><fo:block><xsl:value-of 
select="position()"/></fo:block></fo:table-cell>       
      </xsl:if>
     </xsl:if>
    </xsl:for-each>
   
  </fo:table-row>
<xsl:template>



> Thanks for the response. Yes, its definitely a hack because I 
> could not put
> a </fo:table-row> inside the <xsl:if> tag. I get an error 
> message saying
> The element type "xsl:if" must be terminated by the matching end-tag
> "</xsl:if>"
> 
> Is there a better way to accomplish what I need to do...i.e. ouputting
> portions of table-row tags depending on certain conditions? Thanks.
> 



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

Reply via email to