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

Re: Ask for examples of using Dimitre's generic sort f

Subject: Re: Ask for examples of using Dimitre's generic sort function
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 7 Jul 2001 22:50:21 -0700 (PDT)
sort.f
Sun-fu Yang wrote:

> I try very hard to understand the results from your example of using
> genericSearchSort.sort.data.1.xml with genericSearchSort.sort.1.xsl.
> 
> I do not have idea what does two-digit number shown in  each result stand
> for.
> for example, Result: 01 10 03 09 06 ...   Could you please give some words
> on it?

Hi Sun-fu,

The result is a space-delimited string representation of the nodelist resulting from
the sort operation.

In the example above the result means that the "smallest node" has position 1,
the next one has position 10, the next one has position 3,... etc.

All positions have exactly the same number of digits (the same as 
string-length(count(theNodeSet))). So, in case the node-set to be sorted had only 9
elements, the above result would be:

1 3 9 6 ...   

This is by design, so that picking an individual position from this string should
not be difficult -- the k-th position will be:

substring(theResult, ($k - 1)*($posLength + 1) + 1, $posLength), where $posLength is
defined as above:

<xsl:variable name="posLength" select="string-length(count(theNodeSet))"/>


I realise though, that even this may be difficult for subsequent processing of the
results of the sort (e.g. one will have to use a recursive template in order to
process the sorted sequence of nodes).

I could create a nodeset of positions (or their respective nodes' generate-id()-s),
so that it can be processed immediately with an xsl:for-each ? 
Do you think this would be useful?

I would be happy to further assist you in using this template, do not hesitate to
contact me.

Cheers,
Dimitre Novatchev.

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.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.