roadcone20
Programmer
Hi All -
I'm attempting to sum up some values in XML using an XSL transformation. I'm having some trouble, as I'm really new to XSL.
Here's an example of the potential XML:
What I would like to do is sum the Delivered/Quantity values for all PurchaseOrderLineItem/GoodsReceivedNoteItem/GoodsReceivedNoteItem, that are from the latest date in <ReceiptDate>.
So in the example above, the latest date in <ReceiptDate is 2007-07-02, so I want to sum all values in Delivered/Quantity that have this date.
I can find the last date, however, I'm having trouble using that to sum the values.
A push in the right direction would be GREATLY appreciated. Thanks!
I'm attempting to sum up some values in XML using an XSL transformation. I'm having some trouble, as I'm really new to XSL.
Here's an example of the potential XML:
Code:
<PurchaseOrderLineItems>
<PurchaseOrderLineItem>
<Quantity>2</Quantity>
<Price>50.00</Price>
<GoodsReceivedNoteItems>
<GoodsReceivedNoteItem>
<ReceiptDate>2007-07-02 00:00:00</ReceiptDate>
<Delivered>
<Quantity>1</Quantity>
</Delivered>
</GoodsReceivedNoteItem>
<GoodsReceivedNoteItems>
</PurchaseOrderLineItem>
<PurchaseOrderLineItem>
<Quantity>3</Quantity>
<Price>25.00</Price>
<GoodsReceivedNoteItems>
<GoodsReceivedNoteItem>
<ReceiptDate>2007-07-01 00:00:00</ReceiptDate>
<Delivered>
<Quantity>1</Quantity>
</Delivered>
</GoodsReceivedNoteItem>
<GoodsReceivedNoteItem>
<ReceiptDate>2007-07-02 00:00:00</ReceiptDate>
<Delivered>
<Quantity>2</Quantity>
</Delivered>
</GoodsReceivedNoteItem>
</GoodsReceivedNoteItems>
</PurchaseOrderLineItem>
</PurchaseOrderLineItems>
What I would like to do is sum the Delivered/Quantity values for all PurchaseOrderLineItem/GoodsReceivedNoteItem/GoodsReceivedNoteItem, that are from the latest date in <ReceiptDate>.
So in the example above, the latest date in <ReceiptDate is 2007-07-02, so I want to sum all values in Delivered/Quantity that have this date.
I can find the last date, however, I'm having trouble using that to sum the values.
A push in the right direction would be GREATLY appreciated. Thanks!