From 5fab58cf985d1f3bf69a0f78a5e6f72ca8176269 Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 20 Apr 2008 19:31:54 +0200 Subject: [PATCH] Check the name in call-template --- TEST | 5 ++--- instructions.lisp | 18 +++++++++--------- xslt.lisp | 2 ++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/TEST b/TEST index 040bffb..3d06d33 100644 --- a/TEST +++ b/TEST @@ -12520,8 +12520,7 @@ PASS Errors_err017 [Mixed]: raised an xslt-error as expected Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err017.saxon Actual output: MSFT_Conformance_Tests/Errors/Errors_err017.xuriella -FAIL Errors_err021 [Mixed]: condition of incorrect type: -The value NIL is not of type (SIMPLE-ARRAY CHARACTER). +PASS Errors_err021 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Errors/call-noname.noindent-xsl Data: MSFT_Conformance_Tests/Errors/data.xml Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err021.saxon @@ -19432,4 +19431,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 2873/3080 tests (3 expected failures, 204 unexpected failures). +Passed 2874/3080 tests (3 expected failures, 203 unexpected failures). diff --git a/instructions.lisp b/instructions.lisp index 437d439..2500829 100644 --- a/instructions.lisp +++ b/instructions.lisp @@ -678,15 +678,15 @@ (define-instruction xsl:call-template (args env) (destructuring-bind (name &rest param-binding-specs) args - (let ((param-bindings - (compile-var-bindings param-binding-specs env))) - (multiple-value-bind (local-name uri) - (decode-qname name env nil) - (setf name (cons local-name uri))) - (lambda (ctx) - (call-template ctx name - (loop for (name nil value-thunk) in param-bindings - collect (list name (funcall value-thunk ctx)))))))) + (let ((param-bindings + (compile-var-bindings param-binding-specs env))) + (multiple-value-bind (local-name uri) + (decode-qname name env nil) + (setf name (cons local-name uri))) + (lambda (ctx) + (call-template ctx name + (loop for (name nil value-thunk) in param-bindings + collect (list name (funcall value-thunk ctx)))))))) ;; fixme: incompatible with XSLT 2.0 (define-instruction xsl:document (args env) diff --git a/xslt.lisp b/xslt.lisp index ca4d405..8decee1 100644 --- a/xslt.lisp +++ b/xslt.lisp @@ -182,6 +182,8 @@ (xslt-error "not a qname: ~A" str)))) (defun decode-qname (qname env attributep) + (unless qname + (xslt-error "missing name")) (multiple-value-bind (prefix local-name) (split-qname qname) (values local-name -- 2.11.4.GIT