[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

sorting product descriptions

Subject: sorting product descriptions
From: Tobias Reif <tobiasreif@xxxxxxxxx>
Date: Thu, 26 Apr 2001 08:16:02 -0700 (PDT)
xsl bubble sort
Hi all;

I need to sort a list of product-descriptions, in the
form

<products>
	<product id="a_a_00_03">
		...content...
	</product>
...........
</products>

The "id"s can take the form
a_a_00_00 or a_a_90_30_20 or even a_b_100_30

I wrote a horrific sorting thing
http://www.pinkjuice.com/temp/XSLT/sort-products/
which works only with 2 pairs of digits, is very
verbose and slow, and seems to be unable to deal with
"id"s that don't form a sequence.
(it generates a sequence of "id"s, and outputs any
item that has the same; if there are only two items to
sort, but their numbers are different by thousands,
this thing would probably take 10 minutes to sort two
items ;) )

I would be interested in the shortest, simplest,
fastest way to deal with this ;)

Is this possible in XSLT?
(("bubble-sort"?:)go through all items; check pairs
consisting the current one and the following one: if
they are in the correct order, leave them, if they are
placed the wrong way round, switch them. stop as soon
as there's nothing left to swith.)

Tobi

=====
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.htm

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.