473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

sorting outside once sorted inside

2 New Member
Hi, Ive been at this for ages but cant seem to figure it out.

I have a number of lettings that need to be sorted. I can list the lettings by LETID and then inside each letting show PLAN1 and PLAN2 with the cheapest one first. However, then...depending on the cheapest PLAN out of any of the lettings, I need to display each LETID along with its PLAN1 and PLAN2 in ascending order but this is where I get lost.

the xml:
<Lettings>
<Letting>
<LettingTypes>
<LettingType LetID="SM" NumberOfUnits="25">
<LettingDescription Name="Supermarket">
<Text>Supermarket in Herring</Text>
</LettingDescription>
</LettingType>
</LettingTypes>
<LettingTypes>
<LettingType LetID="DE" NumberOfUnits="25">
<LettingDescription Name="Deli">
<Text>Deli in Hindel</Text>
</LettingDescription>
</LettingType>
</LettingTypes>

<LettingRates>
<LettingRate LetID="SM" LetPlanCode="PLAN1">
<Rates>
<Rate>
<Total AmountAfterTax="1040.00"/>
</Rate>
</Rates>
</LettingRate>
<LettingRate LetID="DE" LetPlanCode="PLAN1">
<Rates>
<Rate>
<Total AmountAfterTax="840.00"/>
</Rate>
</Rates>
</LettingRate>
<LettingRate LetID="SM" LetPlanCode="PLAN2">
<Rates>
<Rate>
<Total AmountAfterTax="1290.00"/>
</Rate>
</Rates>
</LettingRate>
<LettingRate LetID="DE" LetPlanCode="PLAN2">
<Rates>
<Rate>
<Total AmountAfterTax="1090.00"/>
</Rate>
</Rates>
</LettingRate>
</LettingRates>
</Letting>
</Lettings>

this is what i have so far:
-- Letting Types / Letting Type --
@Number of Units: 25
@Letting Type Code: SM

Letting Description @Name: Supermarket
Letting Description / Text: Supermarket in Herring

-- Letting Rates / Letting Rate --
@Let ID: SM
@Let Plan Code: PLAN1

Rates / Rate / Total @Amount After Tax: 1040.00

@Let ID: SM
@Let Plan Code: PLAN2

Rates / Rate / Total @Amount After Tax: 1290.00

-- Letting Types / Letting Type --

@Number of Units: 25
@Letting Type Code: DE

Letting Description @Name: Deli
Letting Description / Text: Deli in Hindel

-- Letting Rates / Letting Rate --
@Let ID: DE
@Let Plan Code: PLAN1

Rates / Rate / Total @Amount After Tax: 840.00

@Let ID: DE
@Let Plan Code: PLAN2

Rates / Rate / Total @Amount After Tax: 1090.00


However... because 840.00 is less than 1040, this letting type should be displayed first like:

-- Letting Types / Letting Type --


@Number of Units: 25
@Letting Type Code: DE

Letting Description @Name: Deli
Letting Description / Text: Deli in Hindel

-- Letting Rates / Letting Rate --
@Let ID: DE
@Let Plan Code: PLAN1

Rates / Rate / Total @Amount After Tax: 840.00

@Let ID: DE
@Let Plan Code: PLAN2

Rates / Rate / Total @Amount After Tax: 1090.00

-- Letting Types / Letting Type --
@Number of Units: 25
@Letting Type Code: SM

Letting Description @Name: Supermarket
Letting Description / Text: Supermarket in Herring

-- Letting Rates / Letting Rate --
@Let ID: SM
@Let Plan Code: PLAN1

Rates / Rate / Total @Amount After Tax: 1040.00

@Let ID: SM
@Let Plan Code: PLAN2

Rates / Rate / Total @Amount After Tax: 1290.00

-- Letting Types / Letting Type --


@Number of Units: 25
@Letting Type Code: DE

Letting Description @Name: Deli
Letting Description / Text: Deli in Hindel

-- Letting Rates / Letting Rate --
@Let ID: DE
@Let Plan Code: PLAN1

Rates / Rate / Total @Amount After Tax: 840.00

@Let ID: DE
@Let Plan Code: PLAN2

Rates / Rate / Total @Amount After Tax: 1090.00


--- Please Help! Cheers! sorry about the long post, was just trying to give a good overview of the problem.
Feb 14 '08 #1
2 1142
jkmyoung
2,057 Recognized Expert Top Contributor
Can I ask how you are sorting the xml? Is it XSLT, PHP, javascript, a different DOM??
Feb 14 '08 #2
NikStar
2 New Member
Im using XSLT to do the transformation
Feb 15 '08 #3

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

Similar topics

20
by: Xah Lee | last post by:
Sort a List Xah Lee, 200510 In this page, we show how to sort a list in Python & Perl and also discuss some math of sort. To sort a list in Python, use the “sort” method. For example: ...
19
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to...
4
by: FBM | last post by:
Hi, I am working on a program that simulates one of the elements of ATM. The simulation stores events which occurs every some milliseconds for a certain amount of time. Every time that an event...
7
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the...
4
by: Trent | last post by:
Still have problems with this thing. Seems my results are not matching the "correct" example given. The three sets of numbers below the last 3 columns is suppose to be the number of comparisons...
2
by: james_027 | last post by:
hi, are there available library or pythonic algorithm for sorting a list of list depending on the index of the list inside the list of my choice? d_list = , , , ,
1
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar...
3
KevinADC
by: KevinADC | last post by:
If you are entirely unfamiliar with using Perl to sort data, read the "Sorting Data with Perl - Part One and Two" articles before reading this article. Beginning Perl coders may find this article...
7
Plater
by: Plater | last post by:
I am having trouble determining when my DataGridView object is sorting (based on a column header click). The idea is, in a large table, sorting the columns takes time, so I show a splash screen....
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.