[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|