[xsl] dividing a structure into fractions

Subject: [xsl] dividing a structure into fractions
From: Gavin Montague <lists@xxxxxxxxxxxxxxx>
Date: Wed, 6 Jul 2005 16:25:09 +0100
Hi all,

I'd be very grateful if someone could tell me the best method of sorting a repeating unit of arbitrary length into equal parts, for example.

<units>
    <unit_1 />
    <unit_2 />
    <unit_3 />
    <unit_4 />
    <unit_5 />
    <unit_6 />
    <unit_7 />
    <unit_8 />
<units>

into...

    <part>
        <unit_1 />
        <unit_2 />
        <unit_3 />
    </part>
    <part>
        <unit_4 />
        <unit_5 />
        <unit_6 />
    </part>
    <part>
        <unit_7 />
        <unit_8 />
    </part>

My experiments with for loops have come to naught.

Many thanks,
    Gavin

Current Thread