From 7d6a91ecb536d82c8c358a0fcd2102482626d1f8 Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Sun, 3 Aug 2003 08:02:34 +0000 Subject: [PATCH] Bug 117552 --- ChangeLog | 8 ++ libxslt/xsltutils.c | 21 ++- tests/docs/Makefile.am | 1 + tests/docs/bug-125.xml | 118 ++++++++++++++++ tests/general/Makefile.am | 1 + tests/general/bug-125.out | 352 ++++++++++++++++++++++++++++++++++++++++++++++ tests/general/bug-125.xsl | 101 +++++++++++++ 7 files changed, 598 insertions(+), 4 deletions(-) create mode 100644 tests/docs/bug-125.xml create mode 100644 tests/general/bug-125.out create mode 100644 tests/general/bug-125.xsl diff --git a/ChangeLog b/ChangeLog index 1dd391e..b24f11e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sun Aug 3 15:50:51 HKT 2003 William Brack + + Fixed bug 117552 - sort with multiple keys + * xsltutils.c: enhanced treatment of NaN when multiple sort + keys are specified. + * tests/general/Makefile.am tests/docs/Makefile.am: + Added test case (bug-125) to regression suite. + Sat Aug 2 09:55:38 HKT 2003 William Brack Fixing bug 118561 (IRIX MIPSPro compiler warnings) diff --git a/libxslt/xsltutils.c b/libxslt/xsltutils.c index 0beefaf..32bb179 100644 --- a/libxslt/xsltutils.c +++ b/libxslt/xsltutils.c @@ -894,11 +894,24 @@ xsltDefaultSortFunction(xsltTransformContextPtr ctxt, xmlNodePtr *sorts, res = resultsTab[depth]; if (res == NULL) break; - if (res[j] == NULL) - tst = 1; - else { + if (res[j] == NULL) { + if (res[j+incr] != NULL) + tst = 1; + } else { if (numb) { - if (res[j]->floatval == res[j + incr]->floatval) + /* We make NaN smaller than number in + accordance with XSLT spec */ + if (xmlXPathIsNaN(res[j]->floatval)) { + if (xmlXPathIsNaN(res[j + + incr]->floatval)) + tst = 0; + else + tst = -1; + } else if (xmlXPathIsNaN(res[j + incr]-> + floatval)) + tst = 1; + else if (res[j]->floatval == res[j + incr]-> + floatval) tst = 0; else if (res[j]->floatval > res[j + incr]->floatval) diff --git a/tests/docs/Makefile.am b/tests/docs/Makefile.am index 851b711..9ca0715 100644 --- a/tests/docs/Makefile.am +++ b/tests/docs/Makefile.am @@ -124,6 +124,7 @@ EXTRA_DIST = \ bug-122.xml \ bug-123.xml \ bug-124.xml \ + bug-125.xml \ character.xml \ array.xml \ items.xml diff --git a/tests/docs/bug-125.xml b/tests/docs/bug-125.xml new file mode 100644 index 0000000..90b36d6 --- /dev/null +++ b/tests/docs/bug-125.xml @@ -0,0 +1,118 @@ + + + + Replace "at once" with "both". + + + Replace "the previous explanation of namespaces" with "the example of + namespaces in Example 2-1". + + + Replace "content-encoding" with "content encoding". + The hyphen implies the "Content-Encoding" HTTP header, and + here I am referring instead to the general concept of content + encoding. + + + As of this current errata update, the RPC::XMLSimple package has not yet + been released to CPAN. Until it is released, none of the examples using + this module can be run as presented. + + + Replace "resolve_name" (in the error message) with "get_data". + + + The last character of this line, ">", should be replaced with "/>" in + order to make it valid XML. + + + Replace "soap:address" with "http:address". + + + Replace "more" with "most". + + + Replace "different" with "difference". + + + Replace "out of hand" with "out-of-band". + + + Replace "sequence," with "sequence" (remove the comma). + + + Replace "Description" with "Definition". + + + The script should start with the line, "#!/usr/bin/perl -w" before the + first line of actual code. + + + The script should start with the line, "#!/usr/bin/perl -w" before the + first line of actual code. + + + The script should start with the line, "#!/usr/bin/perl -w" before the + first line of actual code. + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Append " -w" after "perl". + + + Replace "#!perl" with "#!/usr/bin/perl". + This and the identical changes later are for consistency with + other code examples. + + + Replace "#!perl" with "#!/usr/bin/perl". + + + Replace "#!perl" with "#!/usr/bin/perl". + + + Append " -w" after "perl". + + diff --git a/tests/general/Makefile.am b/tests/general/Makefile.am index dfdab8b..982faa0 100644 --- a/tests/general/Makefile.am +++ b/tests/general/Makefile.am @@ -129,6 +129,7 @@ EXTRA_DIST = \ bug-122.out bug-122.xsl \ bug-123.out bug-123.xsl \ bug-124.out bug-124.xsl \ + bug-125.out bug-125.xsl \ character.out character.xsl \ character2.out character2.xsl \ itemschoose.out itemschoose.xsl \ diff --git a/tests/general/bug-125.out b/tests/general/bug-125.out new file mode 100644 index 0000000..5e9ac4b --- /dev/null +++ b/tests/general/bug-125.out @@ -0,0 +1,352 @@ + +
+
+ + + + + + +
Page: 17Line: 2CLARIFICATION
+

Replace "the previous explanation of namespaces" with "the example of namespaces in Example 2-1".

+
+
+ + + + + + +
Page: 28Paragraph: 3Line: 1GRAMMAR
+

Replace "at once" with "both".

+
+
+ + + + + + +
Page: 40Paragraph: 1Line: 5CLARIFICATION
+

Replace "content-encoding" with "content encoding".

+
+

+The hyphen implies the "Content-Encoding" HTTP header, and here I am referring instead to the general concept of content encoding. +

+
+
+
+ + + + + + +
Page: 47Line: 33CORRECTION
+

Replace "resolve_name" (in the error message) with "get_data".

+
+
+ + + + + +
Page: 52Paragraph: 3UPDATE
+

As of this current errata update, the RPC::XMLSimple package has not yet been released to CPAN. Until it is released, none of the examples using this module can be run as presented.

+
+
+ + + + + + +
Page: 53Line: 24CORRECTION
+

The script should start with the line, "#!/usr/bin/perl -w" before the first line of actual code.

+
+
+ + + + + + +
Page: 59Line: 16CORRECTION
+

The script should start with the line, "#!/usr/bin/perl -w" before the first line of actual code.

+
+
+ + + + + + +
Page: 68Line: 4CORRECTION
+

The script should start with the line, "#!/usr/bin/perl -w" before the first line of actual code.

+
+
+ + + + + + +
Page: 115Line: 20CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 120Line: 30CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 146Line: 10CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 151Line: 27CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 157Line: 16CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 165Line: 26CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 166Line: 25CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 168Line: 20CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 170Line: 1CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 171Line: 18CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 172Line: 20CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 174Line: 9CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 175Line: 6CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 176Line: 23CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 186Line: 32CORRECTION
+

The last character of this line, ">", should be replaced with "/>" in order to make it valid XML.

+
+
+ + + + + + +
Page: 203Paragraph: 2Line: 3CORRECTION
+

Replace "soap:address" with "http:address".

+
+
+ + + + + + +
Page: 232Line: 3CORRECTION
+

Append " -w" after "perl".

+
+
+ + + + + + +
Page: 237Paragraph: 1Line: 6GRAMMAR
+

Replace "more" with "most".

+
+
+ + + + + + +
Page: 245Paragraph: 4Line: 2CORRECTION
+

Replace "different" with "difference".

+
+
+ + + + + + +
Page: 247Paragraph: 4Line: 5CORRECTION
+

Replace "out of hand" with "out-of-band".

+
+
+ + + + + + +
Page: 251Paragraph: 2Line: 4GRAMMAR
+

Replace "sequence," with "sequence" (remove the comma).

+
+
+ + + + + + +
Page: 253Line: 24CORRECTION
+

Replace "#!perl" with "#!/usr/bin/perl".

+
+

+This and the identical changes later are for consistency with other code examples. +

+
+
+
+ + + + + + +
Page: 274Line: 9CORRECTION
+

Replace "#!perl" with "#!/usr/bin/perl".

+
+
+ + + + + + +
Page: 274Line: 19CORRECTION
+

Replace "#!perl" with "#!/usr/bin/perl".

+
+
+ + + + + + +
Page: 297Line: 1CORRECTION
+

Replace "Description" with "Definition".

+
+
+ + + + + + +
Page: 431Line: 9CORRECTION
+

Append " -w" after "perl".

+
+
diff --git a/tests/general/bug-125.xsl b/tests/general/bug-125.xsl new file mode 100644 index 0000000..2d48f89 --- /dev/null +++ b/tests/general/bug-125.xsl @@ -0,0 +1,101 @@ + + + + + + + + Generated by + +
+ + + + + + + +
+
+ + +
+ + + + +
+
+ + + +

+ +

+ +
+
+ + +
+

+ + +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Page: Paragraph: Line:
Page: Paragraph:
Page: Line:
Page:
+
+ +
-- 2.7.4