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

Re: sorting by comparing two nodes

Subject: Re: sorting by comparing two nodes
From: Claus Nagel <claus_nagel@xxxxxx>
Date: Tue, 20 Dec 2005 09:17:03 +0100
Re:  sorting by comparing two nodes
> I am not all that clear on how you would sort these.

I try to implement a Graham scan to compute the convex hull of the
points.

> expr:= sqrt((x-$ref/x)^2+(y-$ref/y)^2)

thanks for your idea. but your expr just takes one point and the reference
point as the sorting key. my sorting key changes each time another pair of
points is compared.

well, what I need would be something like:
<xsl:for-each select="$points">
    <xsl:sort select="expr"/>
    --> to compute the expr I need to know the values af the actual point and
          the values of its predecessor.
</xsl:for-each>

I know I can't access the predecessor in a xsl:sort. But is there another
way to implement this? Well in the end it is just a normal quicksort with
a function which compares two elements and returns -1 or 0 or 1 to determine
the way of sorting.

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.