Re: [xsl] seemingly simple transform, need idea how to do it.

Subject: Re: [xsl] seemingly simple transform, need idea how to do it.
From: Trevor Nash <tcn@xxxxxxxxxxxxx>
Date: Wed, 09 Oct 2002 18:59:17 +0100
On Tue, 8 Oct 2002 08:48:07 -0500, Will Carter wrote:

>I want to be able to sort on the Billy funThing or Billy badThing columns. 
> Seems like I am doing too much to set variable with position, 
>jump out of that loop to get the Billy contents.

I will let others on the list complain about the 'jump out of the
loop' bit ;-)

I guess your problem is that if the input XML is not in date order
already, the 'Johnny' columns get sorted OK but the 'Billy' columns
stay in document order?

That is because the position you are saving is the position in the
sorted node list, so the earliest date will always be position 1.
Then when you use this number to pick a Billy node, you will get the
first in the document regardless of what date it is.

So: find the Billy information by selecting on the date rather than
the position.

When you have that working, come back to the FAQ and look up grouping
using xsl:key (called 'Meunchian grouping').  That will let you do
neat things like cope with input where Billy and Johnny do things on
different days, so you have to leave some of the columns blank.

Hope that helps,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread