[xsl] Converting XSLT 2.0 Group into XSLT 1.0 Muenchian Method

Subject: [xsl] Converting XSLT 2.0 Group into XSLT 1.0 Muenchian Method
From: Vincent Ng <vincent.ng@xxxxxxxxxxxxxxxxx>
Date: Wed, 10 Jan 2007 22:47:38 +0800
Hi,

I would like to implement following XSLT 2.0 XSL (tested working with
Saxon 8.7.3) using XSLT 1.0.
Does anyone know the equivalent XSL using XSLT 1.0?
Basically, I need to transform the source XML by grouping
similiar values in
<VendorNo>,ChargeToCode>,<ShipToCode>,<CustomerPO>,<ReqDate>,<ShipMethod>

I have looked into http://www.jenitennison.com/xslt/grouping/index.xml
and other literature on Muenchian Method under XSLT 1.0. , but could
not figure out how to convert the code. I'll be grateful for any
suggestion. Thanks.

<?xml version='1.0' ?>
<xsl:stylesheet xmlns:a="urn:test-com:IMS:IMS:V0001" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
<cIMSDirectHeaderLine>
<IMSDirect>
<xsl:for-each-group select="a:cIMSDirect/IMSDirect/IMSDirect"
group-by="VendorNo">
<xsl:for-each-group select="current-group()" group-by="ChargeToCode">
<xsl:for-each-group select="current-group()" group-by="ShipToCode">
<xsl:for-each-group select="current-group()" group-by="CustomerPO">
<xsl:for-each-group select="current-group()" group-by="ReqDate">
<xsl:for-each-group select="current-group()" group-by="ShipMethod">
<IMSDirect>
<IMSDirectHeader>
<VendorNo>
<xsl:value-of select="VendorNo"/>
</VendorNo>
<ChargeToCode>
<xsl:value-of select="ChargeToCode"/>
</ChargeToCode>
<ShipToCode>
<xsl:value-of select="ShipToCode"/>
</ShipToCode>
<CustomerPO>
<xsl:value-of select="CustomerPO"/>
</CustomerPO>
<ReqDate>
<xsl:value-of select="ReqDate"/>
</ReqDate>
<ShipMethod>
<xsl:value-of select="ShipMethod"/>
</ShipMethod>
</IMSDirectHeader>
<xsl:for-each select="current-group()">
<IMSDirectLine>
<PartNo>
<xsl:value-of select="PartNo"/>
</PartNo>
<Qty>
<xsl:value-of select="Qty"/>
</Qty>
<PriorityCode>
<xsl:value-of select="PriorityCode"/>
</PriorityCode>
<ControlNo>
<xsl:value-of select="ControlNo"/>
</ControlNo>
<VendorName>
<xsl:value-of select="VendorName"/>
</VendorName>
<Desrp>
<xsl:value-of select="Desrp"/>
</Desrp>
<CustomerPartNo>
<xsl:value-of select="CustomerPartNo"/>
</CustomerPartNo>
<CustomerItemNo>
<xsl:value-of select="CustomerItemNo"/>
</CustomerItemNo>
<SeqNo>
<xsl:value-of select="SeqNo"/>
</SeqNo>
<VendorBlanketPO>
<xsl:value-of select="VendorBlanketPO"/>
</VendorBlanketPO>
<SeriesCode>
<xsl:value-of select="SeriesCode"/>
</SeriesCode>
<ShipFrom>
<xsl:value-of select="ShipFrom"/>
</ShipFrom>
<Filler>
<xsl:value-of select="Filler"/>
</Filler>
</IMSDirectLine>
</xsl:for-each>
</IMSDirect>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:for-each-group>
</xsl:for-each-group>
</IMSDirect>
</cIMSDirectHeaderLine>
</xsl:template>
</xsl:stylesheet>

Current Thread