Re: [xsl] Collation for dotted decimal?

Subject: Re: [xsl] Collation for dotted decimal?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 7 Feb 2006 16:19:10 GMT
> In order to get this it would be necessary to "left pad" each member of the sequence with zeros.

exactly, that's what  format-number(number($i),$vPattern) does. In the
example I posted I just used a pattern of '000000' so everything got
padded to 6 digits, and if any numbers were 7 digits originally it did
the wrong thing. Dimitre just modified it to make sure that the list of
000 is sufficiently long (taking a wild over-estimate, actually, bt it
doesn't matter).

>   What I understand this to do is to select the shortest
>   dotted-decimal in the document, and then create a sequenceby
>   replacing any non-zero digit or dot with a zero. And that's where
>   I'm certain I'm lost. I can't picture the "template" it would
>   produce and how applying that template would produce a left-padding
>   of zeros. 

It takes the longest string in all your <x> elements and then creates a
string consisting of that many 0's by translating all the digits and
decimal points to zero. (You know that is all the content, from the
problem description.) so if the longets entry is the
format-number pattern will be 0000000000 and the sort key for that entry
will be

and the sort keys  for every other entry will have identical length and
you can do lexicographic rather than numeric sorting.


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

Current Thread