''
authorWilliam M. Brack <wbrack@src.gnome.org>
Thu, 15 May 2003 08:40:08 +0000 (08:40 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Thu, 15 May 2003 08:40:08 +0000 (08:40 +0000)
libxslt/xsltutils.c
tests/general/bug-120.out

index 48afe89..e9dd427 100644 (file)
@@ -847,15 +847,15 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
                    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;
index 3fc36a1..db5ff97 100644 (file)
@@ -1,8 +1,8 @@
 <?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>