4. List all the orders with the total of each order displayed
Similar to number 2, however, this time you need to show the subtotal for each
orderline and the grand total of the order. An example of the output for a single
order is as followed:
Order Number:O8
Kevin Sheedy
10 High St Essendon Victoria 3622
Quantity Category Item Unit Price Discount Subtotal
10 Non-alcoholic Drink Orange Juice $1.50 0 $15.00
5 Alcoholic Drink Red Wine $15.00 0 $75.00
10 Sandwich Tomato and Ham $2.00 0 $20.00
10 Sandwich Vegetarian Sandwich $2.00 0 $20.00
20 Sandwich Salmon Sandwich $3.00 0 $60.00
50 Hot Snack Springroll $0.50 0 $25.00
5 Alcoholic Drink White Wine $12.00 0 $60.00
Total Amount $275.00
Its actually in a table format..
And the files that i was provided are customers.xml
<?xml version="1.0" ?>
- <customers xsi:noNamespaceSchemaLocation="customers.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <customer no="P111" corporate="false">
<name>James Hird</name>
- <address>
<street>12 Raleigh Rd</street>
<suburb>North Melbourne</suburb>
<state>Victoria</state>
<postcode>3611</postcode>
</address>
- <contacts>
<home>03-91112222</home>
<office>03-91119999</office>
<mobile primary="yes">04111222333</mobile>
</contacts>
</customer>
- <customer no="C111" corporate="true">
<name>Essendon Football Club</name>
- <address>
<street>10 Windy Ave</street>
<suburb>Windy Hill</suburb>
<state>Victoria</state>
<postcode>3666</postcode>
</address>
- <contacts>
<name>Kevin Sheedy</name>
<office primary="yes">03-91119999</office>
<mobile>04111222444</mobile>
</contacts>
</customer>
- <customer no="P112" corporate="false">
<name>Kevin Sheedy</name>
- <address>
<street>10 High St</street>
<suburb>Essendon</suburb>
<state>Victoria</state>
<postcode>3622</postcode>
</address>
- <contacts>
<home>03-91113333</home>
<office>03-91119999</office>
<mobile primary="yes">04111222444</mobile>
</contacts>
</customer>
- <customer no="P113" corporate="false">
<name>John Worsfold</name>
- <address>
<street>23 Bayview Ave</street>
<suburb>South Perth</suburb>
<state>Western Australia</state>
<postcode>6200</postcode>
</address>
- <contacts>
<home>06-62223333</home>
<office>06-62229999</office>
<mobile primary="yes">04111222555</mobile>
</contacts>
</customer>
- <customer no="P114" corporate="false">
<name>Ben Cousin</name>
- <address>
<street>23 Long Ave</street>
<suburb>West Perth</suburb>
<state>Western Australia</state>
<postcode>6500</postcode>
</address>
- <contacts>
<home>06-62224444</home>
<office>06-62229999</office>
<mobile primary="yes">04111222666</mobile>
</contacts>
</customer>
- <customer no="C112" corporate="true">
<name>West Coast Football Club</name>
- <address>
<street>1 Paxton Dr</street>
<suburb>Subiaco</suburb>
<state>Western Australia</state>
<postcode>6666</postcode>
</address>
- <contacts>
<name>John Worsfold</name>
<office primary="yes">06-62229999</office>
<mobile>04111222555</mobile>
</contacts>
</customer>
</customers>
and orders.xml
<?xml version="1.0"?>
<orders xsi:noNamespaceSchemaLocation="orders.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<order no="O1">
<customerNo>P111</customerNo>
<orderLines>
<orderLine>
<itemNo>I001</itemNo>
<category>Hot Snack</category>
<description>Sausage Roll</description>
<quantity>100</quantity>
<unitPrice>1</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I002</itemNo>
<category>Hot Snack</category>
<description>Meat Pies</description>
<quantity>100</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">10</discount>
</orderLine>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>100</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I004</itemNo>
<category>Alcoholic Drink</category>
<description>Victoria Bitter</description>
<quantity>200</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
</orderLines>
</order>
<order no="O2">
<customerNo>C111</customerNo>
<orderLines>
<orderLine>
<itemNo>I001</itemNo>
<category>Hot Snack</category>
<description>Sausage Roll</description>
<quantity>1500</quantity>
<unitPrice>1</unitPrice>
<discount scale="percentage">20</discount>
</orderLine>
<orderLine>
<itemNo>I002</itemNo>
<category>Hot Snack</category>
<description>Meat Pies</description>
<quantity>2000</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">20</discount>
</orderLine>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>1000</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I004</itemNo>
<category>Alcoholic Drink</category>
<description>Victoria Bitter</description>
<quantity>2000</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">10</discount>
</orderLine>
<orderLine>
<itemNo>I005</itemNo>
<category>Alcoholic Drink</category>
<description>Red Wine</description>
<quantity>200</quantity>
<unitPrice>15</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>500</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>200</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>500</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>1000</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I011</itemNo>
<category>Alcoholic Drink</category>
<description>White Wine</description>
<quantity>500</quantity>
<unitPrice>12</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
</orderLines>
</order>
<order no="O3">
<customerNo>P112</customerNo>
<orderLines>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>30</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I005</itemNo>
<category>Alcoholic Drink</category>
<description>Red Wine</description>
<quantity>5</quantity>
<unitPrice>15</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>30</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>10</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>20</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>100</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I011</itemNo>
<category>Alcoholic Drink</category>
<description>White Wine</description>
<quantity>5</quantity>
<unitPrice>12</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
</orderLines>
</order>
<order no="O4">
<customerNo>C112</customerNo>
<orderLines>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>1000</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>500</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>200</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>500</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>1000</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I012</itemNo>
<category>Cold Snack</category>
<description>Rice Paper Roll</description>
<quantity>1000</quantity>
<unitPrice>1.5</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I013</itemNo>
<category>Hot Snack</category>
<description>BBQ Chicken Wing</description>
<quantity>1500</quantity>
<unitPrice>0.75</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I014</itemNo>
<category>Non-alcoholic Drink</category>
<description>Coke</description>
<quantity>500</quantity>
<unitPrice>1.2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I015</itemNo>
<category>Non-alcoholic Drink</category>
<description>Lemonade</description>
<quantity>500</quantity>
<unitPrice>1.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
</orderLines>
</order>
<order no="O5">
<customerNo>C111</customerNo>
<orderLines>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>1000</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>500</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>200</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>500</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>1000</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I012</itemNo>
<category>Cold Snack</category>
<description>Rice Paper Roll</description>
<quantity>1000</quantity>
<unitPrice>1.5</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I013</itemNo>
<category>Hot Snack</category>
<description>BBQ Chicken Wing</description>
<quantity>1500</quantity>
<unitPrice>0.75</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I014</itemNo>
<category>Non-alcoholic Drink</category>
<description>Coke</description>
<quantity>500</quantity>
<unitPrice>1.2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I015</itemNo>
<category>Non-alcoholic Drink</category>
<description>Lemonade</description>
<quantity>500</quantity>
<unitPrice>1.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
</orderLines>
</order>
<order no="O6">
<customerNo>P113</customerNo>
<orderLines>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>30</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I005</itemNo>
<category>Alcoholic Drink</category>
<description>Red Wine</description>
<quantity>5</quantity>
<unitPrice>15</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>30</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>10</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>20</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>100</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I011</itemNo>
<category>Alcoholic Drink</category>
<description>White Wine</description>
<quantity>5</quantity>
<unitPrice>12</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
</orderLines>
</order>
<order no="O7">
<customerNo>P114</customerNo>
<orderLines>
<orderLine>
<itemNo>I001</itemNo>
<category>Hot Snack</category>
<description>Sausage Roll</description>
<quantity>500</quantity>
<unitPrice>1</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I002</itemNo>
<category>Hot Snack</category>
<description>Meat Pies</description>
<quantity>500</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">10</discount>
</orderLine>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>100</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">2</discount>
</orderLine>
<orderLine>
<itemNo>I004</itemNo>
<category>Alcoholic Drink</category>
<description>Victoria Bitter</description>
<quantity>300</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">5</discount>
</orderLine>
</orderLines>
</order>
<order no="O8">
<customerNo>P112</customerNo>
<orderLines>
<orderLine>
<itemNo>I003</itemNo>
<category>Non-alcoholic Drink</category>
<description>Orange Juice</description>
<quantity>10</quantity>
<unitPrice>1.50</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I005</itemNo>
<category>Alcoholic Drink</category>
<description>Red Wine</description>
<quantity>5</quantity>
<unitPrice>15</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I007</itemNo>
<category>Sandwich</category>
<description>Tomato and Ham Sandwich</description>
<quantity>10</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I008</itemNo>
<category>Sandwich</category>
<description>Vegetarian Sandwich</description>
<quantity>10</quantity>
<unitPrice>2</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I009</itemNo>
<category>Sandwich</category>
<description>Salmon Sandwich</description>
<quantity>20</quantity>
<unitPrice>3</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I010</itemNo>
<category>Hot Snack</category>
<description>Springroll</description>
<quantity>50</quantity>
<unitPrice>0.5</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
<orderLine>
<itemNo>I011</itemNo>
<category>Alcoholic Drink</category>
<description>White Wine</description>
<quantity>5</quantity>
<unitPrice>12</unitPrice>
<discount scale="percentage">0</discount>
</orderLine>
</orderLines>
</order>
</orders>
Hope you can help..