[xsl] group by number

Subject: [xsl] group by number
From: Andreas Lindahl <andreas.lindahl@xxxxxxxxxx>
Date: Fri, 28 Nov 2003 14:10:57 +0100
Hi

I have an xml file which looks pretty much like this:

<items>
	<item>1</item>
	<item>2</item>
	<item>3</item>
	<item>4</item>
	<item>5</item>
	<item>6</item>
	<item>7</item>
	<item>8</item>
	<item>9</item>
</items>

I am planning to use XSLT to convert it to an xml file which should look
like this:

<group id="1">
	<item>1</item>
	<item>2</item>
	<item>3</item>
</group>
<group id="2">
	<item>4</item>
	<item>5</item>
	<item>6</item>
</group>
<group id="3">
	<item>7</item>
	<item>8</item>
	<item>9</item>
</group>

Each group node should contain three item nodes.

How should I do this with XSLT?

Cheers,
Andreas

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread