XSLT grouping and implementing addition

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
Having inbound source like:

<ns0:OrderDetails xmlns:ns0="http://sample
<Order>
<OrderDetail>
<OrderNo>123</OrderNo>
<Zip>,05486</Zip>
<Quantity>
<Item>57</Item>
<Date>,1105</Date>
<Cost>,50.00</Cost>
</Quantity>
<ShipDate>
<Date>1119</Date>
<TotalCost>,50.00</TotalCost>
</ShipDate>
</OrderDetail>
<OrderDetail>
<OrderNo>234</OrderNo>
<Zip>45456</Zip>
<Quantity>
<Item>58</Item>
<Date>,1104</Date>
<Cost>,100.00</Cost>
</Quantity>
<Quantity>
<Item>59</Item>
<Date>,1106</Date>
<Cost>,50.00</Cost>
</Quantity>
<ShipDate>
<Date>1126</Date>
<TotalCost>,150.00</TotalCost>
</ShipDate>
</OrderDetail>
</Order>
<Trailer>
<NoOfrec>2</NoOfrec>
</Trailer>
</ns0:OrderDetails>


Im looking to get the outbound by grouping records depending on OrderNo and also I need to add the cost of a particular order item

<ns0:Orders xmlns:ns0="http://sample
<Header>
<HeaderDetails>123,05486</HeaderDetails>
</Header>
<OrderDetails>
<OrdersDetail>57,1105,50.00</OrdersDetail>
</OrderDetails>
<Footer>
<FooterDetails>1119,50.00</FooterDetails>
</Footer>
<Header>
<HeaderDetails>234,45456</HeaderDetails>
</Header>
<OrderDetails>
<Orders>58,1104,100.00</Orders>
<Orders>59,1106,50.00</Orders>
</OrderDetails>
<Footer>
<FooterDetails>1126,150.00</FooterDetails>
</Footer>
<Trailer>
<TrailerDetails>2</TrailerDetails>
</Trailer>
</ns0:Orders>


Thanks

<br/>
<br/>

View the full article
 
Back
Top