xsl-list
[Top] [All Lists]

Re: [xsl] Ranking Random Nodes from Top to Bottom

2007-08-17 07:08:58
Michael Kay wrote:
This is an interesting hint! Michael, do you mean that this collation order automatically sorts the following "correctly" (defined as: treat numeric parts as numeric)?

root[1]/node[12]
root[1]/node[6]
root[1]/node[11]
root[1]/node[0045]

into:
root[1]/node[6]
root[1]/node[11]
root[1]/node[12]
root[1]/node[0045]


Yes.

Wow, I'm impressed. I guess I should read the docs better ;).

I use a generalized sorting routine that does something like tokenize by numeric values and then sort by appending zeros and concatenating it with the rest into a string (much like my earlier solution in this thread, but more generic). Time to throw that piece of code away ;)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--