I have the following XSLT, I am using identity transform because I need to keep the xml intact and only change a specific section of the XML i.e: the <committee committeetype="Associate">
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:strip-space elements="*"/>
<!--Identity Transform.-->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="committee[@committeetype='Associate']/affiliation">
<Committee CommitteeType="Associate">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</Committee >
</xsl:template>
<xsl:template match="committee[@committeeType='Associate']">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
Transforms
<committee committeetype="Associate">
<affiliation dbid="11">
<name>Eve </name>
</affiliation>
<affiliation dbid="12">
<name>Dan </name>
</affiliation>
<affiliation dbid="13">
<name>Harold </name>
</affiliation>
<affiliation dbid="14">
<name>Chris </name>
</affiliation>
<affiliation dbid="25">
<name>Malcolm </name>
</affiliation>
<affiliation dbid="15">
<name>Mike </name>
</affiliation>
</committee>
Into
<committee committeetype="Associate">
<affiliation dbid="11">
<name>Eve </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="12">
<name>Dan </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="13">
<name>Harold </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="14">
<name>Chris </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="25">
<name>Malcolm </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="15">
<name>Mike </name>
</affiliation>
</committee>
How can i make it so it groups the affiliation into 4 per
<committee committeetype="Associate">
Such as
<committee committeetype="Associate">
<affiliation dbid="11">
<name>Eve </name>
</affiliation>
<affiliation dbid="12">
<name>Dan </name>
</affiliation>
<affiliation dbid="13">
<name>Harold </name>
</affiliation>
<affiliation dbid="14">
<name>Chris </name>
</affiliation>
</committee>
<committee committeetype="Associate">
<affiliation dbid="25">
<name>Malcolm </name>
</affiliation>
<affiliation dbid="15">
<name>Mike </name>
</affiliation>
</committeemembergroup>
Thanks in advance.