From 1258814e4d8d8d6731014b61de9ebee889862cba Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 30 Mar 2008 18:23:55 +0200 Subject: [PATCH] Check apply-templates child nodes --- TEST | 34 ++++------------------------------ parser.lisp | 6 +++++- xslt.lisp | 1 - 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/TEST b/TEST index 64a4b34..816bb74 100644 --- a/TEST +++ b/TEST @@ -10943,15 +10943,7 @@ PASS AVTs__77599 [XSLT-Result-Tree] Expected output (1): MSFT_Conformance_Tests/AVTs/AVTs__77599.saxon Actual output: MSFT_Conformance_Tests/AVTs/AVTs__77599.xuriella -FAIL BVTs_bvt001 [Mixed]: condition of incorrect type: -There is no applicable method for the generic function - # -when called with arguments - (#.(CXML-STP:TEXT - #| :PARENT of type ELEMENT |# - :DATA " -??? -???")). +PASS BVTs_bvt001 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/BVTs/apply-templ.noindent-xsl Data: MSFT_Conformance_Tests/BVTs/data.xml Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt001.saxon @@ -13870,17 +13862,7 @@ PASS Elements_ValidAttribute [XSLT-Result-Tree] Expected output (1): MSFT_Conformance_Tests/Elements/Elements_ValidAttribute.saxon Actual output: MSFT_Conformance_Tests/Elements/Elements_ValidAttribute.xuriella -FAIL Errors__84386 [Mixed]: condition of incorrect type: -There is no applicable method for the generic function - # -when called with arguments - (#.(CXML-STP:TEXT - #| :PARENT of type ELEMENT |# - :DATA " ? - -foo - -")). +PASS Errors__84386 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Errors/84386.noindent-xsl Data: MSFT_Conformance_Tests/Errors/data.xml Expected output (1): MSFT_Conformance_Tests/Errors/Errors__84386.saxon @@ -13916,15 +13898,7 @@ PASS Errors_err001 [Mixed]: raised an xslt-error as expected Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err001.saxon Actual output: MSFT_Conformance_Tests/Errors/Errors_err001.xuriella -FAIL Errors_err002 [Mixed]: condition of incorrect type: -There is no applicable method for the generic function - # -when called with arguments - (#.(CXML-STP:TEXT - #| :PARENT of type ELEMENT |# - :DATA " - Hello - ")). +PASS Errors_err002 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Errors/apply-pcdata.noindent-xsl Data: MSFT_Conformance_Tests/Errors/data.xml Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err002.saxon @@ -22495,4 +22469,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 2810/3073 tests. +Passed 2813/3073 tests. diff --git a/parser.lisp b/parser.lisp index 08065c3..327a94c 100644 --- a/parser.lisp +++ b/parser.lisp @@ -201,7 +201,11 @@ (multiple-value-bind (decls rest) (loop for i from 0 - for cons on (stp:list-children node) + for cons on (stp:filter-children + (lambda (node) + (or (typep node 'stp:element) + (xslt-error "non-element in apply-templates"))) + node) for (child . nil) = cons while (namep child "sort") collect (parse-sort child) into decls diff --git a/xslt.lisp b/xslt.lisp index ae7b455..62a77fd 100644 --- a/xslt.lisp +++ b/xslt.lisp @@ -112,7 +112,6 @@ specs)) (%node (gensym))) `(let ((,%NODE ,node)) - (declare (ignorable ,%NODE)) (check-for-invalid-attributes ',valid-names ,%NODE) (stp:with-attributes ,specs ,%NODE ,@body)))) -- 2.11.4.GIT