[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Bug Sorting Zeros
Rechell Schwartz writes: >I just tried sorting a list of numbers using Xalan for Java and found >that the value of zero did not sort where I expected it to. In fact it >appears that it was treated as though it was not a number. Our sort01 and sort09 tests are designed to test for this behavior. I'll review what's in there. I'll modify sort13 to try to catch this as well. >Also, is there a way to cause non-numerical values to appear after >numerical values, instead of before? No. Erratum E20 requires before for ascending, after for descending. By combining the meaning of multiple sentences in Chapter 10 of the base document, one can deduce that all the NaN-equivalent values, regardless of what string they are, must occur in document order within the cluster of NaN-equivalents. >Similarly, when sorting strings is there a way to cause numerical values >to appear after all string values instead of before? If your data type is "text", numbers get no special recognition. It appears that you want to do a two-level sort, where the upper level is a boolean on numeric vs. non-numeric (likely inefficient to calculate) and the lower sort is numeric. If you also need the text strings to be alphabetically ordered at the same time that the numbers are sorted, you'll have to look at it as a two-pass situation, possibly using template modes. .................David Marston XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|