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

RE: Ranking Random Nodes from Top to Bottom

Subject: RE: Ranking Random Nodes from Top to Bottom
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 17 Aug 2007 13:59:15 +0100
RE:  Ranking Random Nodes from Top to Bottom
Are "root" and "node" the only element names that appear?

If you had /root[1]/a[3] and /root[1]/b[5], how would you want them sorted?

I would expect that Saxon's alphanumeric collation would do quite a good job
of this:

<xsl:perform-sort select="tokenize(unparsed-text('input.txt'), '\n')">
  <xsl:sort select="."
collation="http://saxon.sf.net/collation?alphanumeric=yes"/>
</xsl:perform-sort>

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: J. Zhang [mailto:j.zhang@xxxxxx] 
> Sent: 17 August 2007 11:46
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Ranking Random Nodes from Top to Bottom
> 
> Hi all,
> 
> I got a long list of absolute xpath paths in a flat file, like
> 
> /root[1]/node[2]/node[12]/node[1]
> /root[1]/node[1]
> /root[1]/node[2]/node[12]/node[1]
> /root[1]/node[4]/node[12]
> /root[1]
> 
> Is there an existing function in Saxon or ready-made code to 
> rank the list of nodes from top to bottom?
> 
> Thanks by advance!
>    jz

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.