Xslt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cswon9
    New Member
    • May 2007
    • 1

    Xslt

    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:noNamespace SchemaLocation= "customers. xsd" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    - <customer no="P111" corporate="fals e">
    <name>James Hird</name>
    - <address>
    <street>12 Raleigh Rd</street>
    <suburb>North Melbourne</suburb>
    <state>Victoria </state>
    <postcode>361 1</postcode>
    </address>
    - <contacts>
    <home>03-91112222</home>
    <office>03-91119999</office>
    <mobile primary="yes">0 4111222333</mobile>
    </contacts>
    </customer>
    - <customer no="C111" corporate="true ">
    <name>Essendo n Football Club</name>
    - <address>
    <street>10 Windy Ave</street>
    <suburb>Windy Hill</suburb>
    <state>Victoria </state>
    <postcode>366 6</postcode>
    </address>
    - <contacts>
    <name>Kevin Sheedy</name>
    <office primary="yes">0 3-91119999</office>
    <mobile>0411122 2444</mobile>
    </contacts>
    </customer>
    - <customer no="P112" corporate="fals e">
    <name>Kevin Sheedy</name>
    - <address>
    <street>10 High St</street>
    <suburb>Essendo n</suburb>
    <state>Victoria </state>
    <postcode>362 2</postcode>
    </address>
    - <contacts>
    <home>03-91113333</home>
    <office>03-91119999</office>
    <mobile primary="yes">0 4111222444</mobile>
    </contacts>
    </customer>
    - <customer no="P113" corporate="fals e">
    <name>John Worsfold</name>
    - <address>
    <street>23 Bayview Ave</street>
    <suburb>South Perth</suburb>
    <state>Wester n Australia</state>
    <postcode>620 0</postcode>
    </address>
    - <contacts>
    <home>06-62223333</home>
    <office>06-62229999</office>
    <mobile primary="yes">0 4111222555</mobile>
    </contacts>
    </customer>
    - <customer no="P114" corporate="fals e">
    <name>Ben Cousin</name>
    - <address>
    <street>23 Long Ave</street>
    <suburb>West Perth</suburb>
    <state>Wester n Australia</state>
    <postcode>650 0</postcode>
    </address>
    - <contacts>
    <home>06-62224444</home>
    <office>06-62229999</office>
    <mobile primary="yes">0 4111222666</mobile>
    </contacts>
    </customer>
    - <customer no="C112" corporate="true ">
    <name>West Coast Football Club</name>
    - <address>
    <street>1 Paxton Dr</street>
    <suburb>Subiaco </suburb>
    <state>Wester n Australia</state>
    <postcode>666 6</postcode>
    </address>
    - <contacts>
    <name>John Worsfold</name>
    <office primary="yes">0 6-62229999</office>
    <mobile>0411122 2555</mobile>
    </contacts>
    </customer>
    </customers>

    and orders.xml

    <?xml version="1.0"?>

    <orders xsi:noNamespace SchemaLocation= "orders.xsd "
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    <order no="O1">
    <customerNo>P11 1</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I001</itemNo>
    <category>Hot Snack</category>
    <description>Sa usage Roll</description>
    <quantity>100 </quantity>
    <unitPrice>1</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I002</itemNo>
    <category>Hot Snack</category>
    <description>Me at Pies</description>
    <quantity>100 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">10</discount>
    </orderLine>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>100 </quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I004</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Vi ctoria Bitter</description>
    <quantity>200 </quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O2">
    <customerNo>C11 1</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I001</itemNo>
    <category>Hot Snack</category>
    <description>Sa usage Roll</description>
    <quantity>150 0</quantity>
    <unitPrice>1</unitPrice>
    <discount scale="percenta ge">20</discount>
    </orderLine>
    <orderLine>
    <itemNo>I002</itemNo>
    <category>Hot Snack</category>
    <description>Me at Pies</description>
    <quantity>200 0</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">20</discount>
    </orderLine>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>100 0</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I004</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Vi ctoria Bitter</description>
    <quantity>200 0</quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">10</discount>
    </orderLine>
    <orderLine>
    <itemNo>I005</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Re d Wine</description>
    <quantity>200 </quantity>
    <unitPrice>15 </unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>200 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>100 0</quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I011</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Wh ite Wine</description>
    <quantity>500 </quantity>
    <unitPrice>12 </unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O3">
    <customerNo>P11 2</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>30</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I005</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Re d Wine</description>
    <quantity>5</quantity>
    <unitPrice>15 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>30</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>10</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>20</quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>100 </quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I011</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Wh ite Wine</description>
    <quantity>5</quantity>
    <unitPrice>12 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O4">
    <customerNo>C11 2</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>100 0</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>200 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>100 0</quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I012</itemNo>
    <category>Col d Snack</category>
    <description>Ri ce Paper Roll</description>
    <quantity>100 0</quantity>
    <unitPrice>1. 5</unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I013</itemNo>
    <category>Hot Snack</category>
    <description>BB Q Chicken Wing</description>
    <quantity>150 0</quantity>
    <unitPrice>0.75 </unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I014</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Co ke</description>
    <quantity>500 </quantity>
    <unitPrice>1. 2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I015</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Le monade</description>
    <quantity>500 </quantity>
    <unitPrice>1. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O5">
    <customerNo>C11 1</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>100 0</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>200 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>500 </quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>100 0</quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I012</itemNo>
    <category>Col d Snack</category>
    <description>Ri ce Paper Roll</description>
    <quantity>100 0</quantity>
    <unitPrice>1. 5</unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I013</itemNo>
    <category>Hot Snack</category>
    <description>BB Q Chicken Wing</description>
    <quantity>150 0</quantity>
    <unitPrice>0.75 </unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I014</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Co ke</description>
    <quantity>500 </quantity>
    <unitPrice>1. 2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I015</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Le monade</description>
    <quantity>500 </quantity>
    <unitPrice>1. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O6">
    <customerNo>P11 3</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>30</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I005</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Re d Wine</description>
    <quantity>5</quantity>
    <unitPrice>15 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>30</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>10</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>20</quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>100 </quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I011</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Wh ite Wine</description>
    <quantity>5</quantity>
    <unitPrice>12 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O7">
    <customerNo>P11 4</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I001</itemNo>
    <category>Hot Snack</category>
    <description>Sa usage Roll</description>
    <quantity>500 </quantity>
    <unitPrice>1</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I002</itemNo>
    <category>Hot Snack</category>
    <description>Me at Pies</description>
    <quantity>500 </quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">10</discount>
    </orderLine>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>100 </quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">2</discount>
    </orderLine>
    <orderLine>
    <itemNo>I004</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Vi ctoria Bitter</description>
    <quantity>300 </quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">5</discount>
    </orderLine>
    </orderLines>
    </order>
    <order no="O8">
    <customerNo>P11 2</customerNo>
    <orderLines>
    <orderLine>
    <itemNo>I003</itemNo>
    <category>Non-alcoholic Drink</category>
    <description>Or ange Juice</description>
    <quantity>10</quantity>
    <unitPrice>1.50 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I005</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Re d Wine</description>
    <quantity>5</quantity>
    <unitPrice>15 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I007</itemNo>
    <category>Sandw ich</category>
    <description>To mato and Ham Sandwich</description>
    <quantity>10</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I008</itemNo>
    <category>Sandw ich</category>
    <description>Ve getarian Sandwich</description>
    <quantity>10</quantity>
    <unitPrice>2</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I009</itemNo>
    <category>Sandw ich</category>
    <description>Sa lmon Sandwich</description>
    <quantity>20</quantity>
    <unitPrice>3</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I010</itemNo>
    <category>Hot Snack</category>
    <description>Sp ringroll</description>
    <quantity>50</quantity>
    <unitPrice>0. 5</unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    <orderLine>
    <itemNo>I011</itemNo>
    <category>Alcoh olic Drink</category>
    <description>Wh ite Wine</description>
    <quantity>5</quantity>
    <unitPrice>12 </unitPrice>
    <discount scale="percenta ge">0</discount>
    </orderLine>
    </orderLines>
    </order>
    </orders>


    Hope you can help..
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    We are not here to do your homework for you. You can ask for help with your ideas only.

    Comment

    Working...