473,408 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Xslt

1
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..
May 13 '07 #1
1 1186
drhowarddrfine
7,435 Expert 4TB
We are not here to do your homework for you. You can ask for help with your ideas only.
May 13 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a...
2
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now...
1
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by...
0
by: Christopher M. Lauer | last post by:
I have done my best to answer this question but can not find the proper set of commands. I would like to transform an xml file (in code behind) and display its output in a specific html tag,...
3
by: Teksure | last post by:
Hi group, searching in the Internet I found two products for XML which incorporate a very robust debugger for XSL/XSLT, I would like you to see these products and then, give me your opinion about...
7
by: Harolds | last post by:
The code below worked in VS 2003 & dotnet framework 1.1 but now in VS 2005 the pmID is evaluated to "" instead of what the value is set to: .... xmlItems.Document = pmXML // Add the pmID...
3
by: Ian Roddis | last post by:
Hello, I want to embed SQL type queries within an XML data record. The XML looks something like this: <DISPLAYPAGE> <FIELD NAME="SERVER" TYPE="DROPDOWN"> <OPTION>1<OPTION> <OPTION>2<OPTION>...
1
by: Sergey Dubinets | last post by:
In effort to prioritize our goals we composed the list of random features each of them may add value to set of XSLT tools offered from Microsoft. 1. XSLTc (Compiler for XSLT...
12
by: Chris | last post by:
Hi, Just wondering if anyone out there knows if it is possible to convert a CSV to xml using XSLT? I've seen a lot of examples of xml to CSV, but is it possible to go back the other way? I...
2
jkmyoung
by: jkmyoung | last post by:
Here's a short list of useful xslt general tricks that aren't taught at w3schools. Attribute Value Template Official W3C explanation and example This is when you want to put dynamic values...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.