Hello,
This is the XML I have
<UNIT UNITNUMBER="6630 " UNITNAME="CommissaryOne">
<ROUTE Vehicle="6630101" RouteDate="06/20/2014" >
<STOP Ticket="075040-20140620" DeliveryCode="075040-20140620">
<RECIPIENT RecipientID="075040" LastName="Test" FirstName="One">
<ORDERS RecipientID="075040" CommodityID="1" FundingClassID="3" Ticket="075040- 20140620" InitialQty="1" DeliveredQty="1" CommodityDescription="FROZEN
5PK D2D (TIII)" />
</RECIPIENT>
</STOP>
<STOP Ticket="074965-20140620" DeliveryCode="074965-20140620">
<RECIPIENT RecipientID="074965" LastName="Test" FirstName="Two">
<ORDERS RecipientID="074965" CommodityID="1" FundingClassID="3" Ticket="074965-20140620" InitialQty="1" DeliveredQty="1" CommodityDescription="FROZEN
5PK D2D (TIII)" />
</RECIPIENT>
</STOP>
<STOP Ticket="074967-20140620" DeliveryCode="074967-20140620">
<RECIPIENT RecipientID="074967" LastName="Test" FirstName="Three">
<ORDERS RecipientID="074967" CommodityID="2" FundingClassID="3" Ticket="074967-20140620" InitialQty="1" DeliveredQty="1" CommodityDescription="Hot
Meal" />
</RECIPIENT>
</STOP>
/ROUTE>
</UNIT>
I would like the result to be displayed as follows:
FROZEN 5PK D2D (TIII) - 2/2/2
Hot Meal - 1/1/1
How can I accomplish this? The XSLT that I inherited has the following section to accomplish this which was working fine till I recently had to upgrade the project from .NET 2.0 to .NET 4.5. I also had to do the following in .NET code to make it work..so not sure if something changed that made the issue popup now. I would appreciate any help.
<xsl:for-each select="STOP/RECIPIENT/ORDERS">
<xsl:sort select="@CommodityDescription"/>
<xsl:if test="@CommodityDescription!=$lastcommodity">
<xsl:variable name="currentcommodity">
<xsl:value-of select="@CommodityDescription"/>
</xsl:variable>
<xsl:variable name="thisroute">
<xsl:value-of select="../../../@Vehicle"/>
</xsl:variable>
<tr><td></td>
<td>
<xsl:value-of select="@CommodityDescription"/>
</td>
<td>
<xsl:variable name="QtyDelivered"><xsl:value-of select="sum(//UNITS/UNIT/ROUTE[@Vehicle=$thisroute]/STOP/RECIPIENT/ORDERS[@CommodityDescription = $currentcommodity]/@DeliveredQty)"/></xsl:variable>
<xsl:variable name="QtyTotal"><xsl:value-of select="sum(//UNITS/UNIT/ROUTE[@Vehicle=$thisroute]/STOP/RECIPIENT/ORDERS[@CommodityDescription = $currentcommodity]/@InitialQty)"/></xsl:variable>
<xsl:variable name="QtyUndelivered"><xsl:value-of select="$QtyTotal - $QtyDelivered"/></xsl:variable>
<xsl:value-of select="$QtyTotal"/>
/ <xsl:value-of select="$QtyDelivered"/>
/ <xsl:value-of select="$QtyUndelivered"/>
</td>
</tr>
</xsl:if>
<xsl:variable name="lastcommodity">
<xsl:value-of select="@CommodityDescription"/>
</xsl:variable>
</xsl:for-each>
Vedala