xsl-list
[Top] [All Lists]

Re: [xsl] Easy question, big headache.

2008-03-11 00:03:26
On 3/11/08, Patrick Bergeron <pbergeron(_at_)innobec(_dot_)com> wrote:
In any other language, it's easy easy:

If (yes_output_record)
{
  count = count + 1;

  if (count modulo 5 = zero)
     output_marker();

  output_record();
}

In XSLT, this might be accomplished as follows:

Suppose $list holds your output list. Then ...

Marker
<xsl:for-each select="$list">
    <xsl:copy-of select="." />
    <xsl:if test="(position() mod 5) = 0">
       Marker
    </xsl:if>
</xsl:for-each>

(This is not tested)


-- 
Regards,
Mukul Gandhi

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--