Re: [xsl] change xslt processing order

Subject: Re: [xsl] change xslt processing order
From: Navin Patel <navin98@xxxxxxxxx>
Date: Sun, 2 Oct 2011 11:43:05 +0100
 Ken,

Can I tweak your xsl to get my desired output shown below or do I need
to use the grouping method,

Thanks

Navin

Expected out:
JD0002210800004322
7255
044375530
JD0002210800004323
7256
044375531
JD0002210800004324
JD0002210800004325
7257
044375532


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";;>
<xsl:output method='text'/>


<xsl:key name="parcelDetailsForAddress" match="DeliveryAddress"
         use="following-sibling::Parcel[1]/@PARCEL_NO"/>
<xsl:key name="parcelDetailsForConsignment" match="Consignment"
         use="following-sibling::Parcel[1]/@PARCEL_NO"/>


 <xsl:variable name='newline'>
 <xsl:text>
</xsl:text>
 </xsl:variable>
<xsl:template match="MR23030B">
<xsl:apply-templates select="Parcel"/>
</xsl:template>


<xsl:template match="Parcel">
<xsl:value-of select="@PARCEL_NO"/>
<xsl:value-of select="$newline"/>
<xsl:apply-templates select="key('parcelDetailsForAddress',@PARCEL_NO)"/>
<xsl:apply-templates select="key('parcelDetailsForConsignment',@PARCEL_NO)"/>
</xsl:template>


<xsl:template match="DeliveryAddress">
<xsl:value-of select="@BRANCH_CODE"/>
<xsl:value-of select="$newline"/>
</xsl:template>


<xsl:template match="Consignment">
<xsl:value-of select="@ACNT_NO"/>
<xsl:value-of select="$newline"/>
</xsl:template>


</xsl:stylesheet>

Current Thread