tst = 1;
else {
if (number) {
- /* We arbitrarily make NaN bigger than number
- (thinking that alpha is usually > number) */
+ /* We make NaN smaller than number in accordance
+ with XSLT spec */
if (xmlXPathIsNaN(results[j]->floatval)) {
if (xmlXPathIsNaN(results[j + incr]->floatval))
tst = 0;
else
- tst = 1;
+ tst = -1;
} else if (xmlXPathIsNaN(results[j + incr]->floatval))
- tst = -1;
+ tst = 1;
else if (results[j]->floatval ==
results[j + incr]->floatval)
tst = 0;
<?xml version="1.0"?>
<a>
Ascending numeric
- <b>-99999999</b><b>-1</b><b>1</b><b>3</b><b>4</b><b/><b/><b/><b>some alpha</b><b/><b/>
+ <b/><b/><b/><b>some alpha</b><b/><b/><b>-99999999</b><b>-1</b><b>1</b><b>3</b><b>4</b>
Descending numeric
- <b/><b/><b/><b>some alpha</b><b/><b/><b>4</b><b>3</b><b>1</b><b>-1</b><b>-99999999</b>
+ <b>4</b><b>3</b><b>1</b><b>-1</b><b>-99999999</b><b/><b/><b/><b>some alpha</b><b/><b/>
Ascending alpha
<b/><b/><b/><b/><b/><b>-1</b><b>-99999999</b><b>1</b><b>3</b><b>4</b><b>some alpha</b></a>