From 7154194342c82a2db4b2aa86ceeaa0bd213749aa Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 20 Apr 2008 22:42:54 +0200 Subject: [PATCH] Check sort/@data-type --- TEST | 8 ++++---- instructions.lisp | 11 +++++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/TEST b/TEST index e745411..d8288b5 100644 --- a/TEST +++ b/TEST @@ -12821,7 +12821,7 @@ PASS Errors_err090 [Mixed]: raised an xslt-error as expected Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err090.saxon Actual output: MSFT_Conformance_Tests/Errors/Errors_err090.xuriella -FAIL Errors_err091 [Mixed]: expected error not signalled: +PASS Errors_err091 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Errors/sort-baddt.noindent-xsl Data: MSFT_Conformance_Tests/Errors/data.xml Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err091.saxon @@ -17018,7 +17018,7 @@ FAIL Sorting__77550 [XSLT-Data-Manipulation]: expected error not signalled: Expected output (1): MSFT_Conformance_Tests/Sorting/Sorting__77550.saxon Actual output: MSFT_Conformance_Tests/Sorting/Sorting__77550.xuriella -FAIL Sorting__77552 [XSLT-Data-Manipulation]: expected error not signalled: +PASS Sorting__77552 [XSLT-Data-Manipulation]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Sorting/XSLT19009.noindent-xsl Data: MSFT_Conformance_Tests/Sorting/sort3.xml Expected output (1): MSFT_Conformance_Tests/Sorting/Sorting__77552.saxon @@ -17036,7 +17036,7 @@ FAIL Sorting__77555 [XSLT-Data-Manipulation]: expected error not signalled: Expected output (1): MSFT_Conformance_Tests/Sorting/Sorting__77555.saxon Actual output: MSFT_Conformance_Tests/Sorting/Sorting__77555.xuriella -FAIL Sorting__77556 [XSLT-Data-Manipulation]: expected error not signalled: +PASS Sorting__77556 [XSLT-Data-Manipulation]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Sorting/XSLT19006.noindent-xsl Data: MSFT_Conformance_Tests/Sorting/sort3.xml Expected output (1): MSFT_Conformance_Tests/Sorting/Sorting__77556.saxon @@ -19413,4 +19413,4 @@ PASS XSLTFunctions_DocumentFuncWithEmptyArg [Mixed] Expected output (1): MSFT_Conformance_Tests/XSLTFunctions/XSLTFunctions_DocumentFuncWithEmptyArg.saxon Actual output: MSFT_Conformance_Tests/XSLTFunctions/XSLTFunctions_DocumentFuncWithEmptyArg.xuriella -Passed 2896/3080 tests (3 expected failures, 181 unexpected failures). +Passed 2899/3080 tests (3 expected failures, 178 unexpected failures). diff --git a/instructions.lisp b/instructions.lisp index 7ddfb1e..5272152 100644 --- a/instructions.lisp +++ b/instructions.lisp @@ -394,7 +394,14 @@ (case-order-thunk (compile-avt (or case-order "") env))) (lambda (ctx) (let ((numberp - (equal (funcall data-type-thunk ctx) "number")) + (let ((d-t (funcall data-type-thunk ctx))) + (cond + ((equal d-t "number") + t) + ((or (equal d-t "") (equal d-t "text")) + nil) + (t + (xslt-error "invalid data-type in sort"))))) (char-table (let ((c-o (funcall case-order-thunk ctx))) (cond @@ -403,7 +410,7 @@ ((or (equal c-o "") (equal c-o "upper-first")) *upper-first-order*) (t - (xslt-error "invalid case-order"))))) + (xslt-error "invalid case-order in sort"))))) (f (if (equal (funcall order-thunk ctx) "descending") -1 1)) (lang -- 2.11.4.GIT