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

Subject: Re: [xsl] Converting XSLT 2.0 Group into XSLT 1.0 Muenchian Method
From: Vincent Ng <vincent.ng@xxxxxxxxxxxxxxxxx>
Date: Fri, 12 Jan 2007 01:12:38 +0800
Thank you, Mukul Gandhi. I have found a solution. The EAI tool I am
using can only support up to XSLT 1.1.

Quoting Mukul Gandhi <gandhi.mukul@xxxxxxxxx>:

> Coding this with XSLT 1.0 would require defining multiple keys (this
> is perhaps the only way ?).
>
> You could see the example of this at my web site:
> http://gandhimukul.tripod.com/grouping.html (the last one - 35th
> example).
>
> But I'll argue, if XSLT 2.0 provides a much powerful and flexible way
> to solve this problem, why do you want to use Muenchian method?
>
> On 1/10/07, Vincent Ng <vincent.ng@xxxxxxxxxxxxxxxxx> wrote:
> > 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>
>
>
> --
> Regards,
> Mukul Gandhi

Current Thread