From 0a80dc1b146caa48698e7483e4133890480ecb8d Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 13 Apr 2008 20:56:42 +0200 Subject: [PATCH] Fixed scope in wrap-namespaces --- TEST | 8 ++++---- parser.lisp | 14 ++++++++------ test.lisp | 16 +++++++++------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/TEST b/TEST index 9747986..b80aae6 100644 --- a/TEST +++ b/TEST @@ -11291,7 +11291,7 @@ PASS BVTs_bvt053 [Mixed] Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt053.saxon Actual output: MSFT_Conformance_Tests/BVTs/BVTs_bvt053.xuriella -FAIL BVTs_bvt054 [Mixed]: output doesn't match +KNOWNFAIL BVTs_bvt054 [Mixed]: output doesn't match Stylesheet: MSFT_Conformance_Tests/BVTs/name.noindent-xsl Data: MSFT_Conformance_Tests/BVTs/data.xml Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt054.saxon @@ -11314,7 +11314,7 @@ PASS BVTs_bvt056 [Mixed] Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt056.saxon Actual output: MSFT_Conformance_Tests/BVTs/BVTs_bvt056.xuriella -FAIL BVTs_bvt057 [Mixed]: output doesn't match +PASS BVTs_bvt057 [Mixed] Stylesheet: MSFT_Conformance_Tests/BVTs/ns-conflict.noindent-xsl Data: MSFT_Conformance_Tests/BVTs/data.xml Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt057.saxon @@ -11344,7 +11344,7 @@ Operation was SB-KERNEL::DIVISION, operands (5 0). Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt061.saxon Actual output: MSFT_Conformance_Tests/BVTs/BVTs_bvt061.xuriella -FAIL BVTs_bvt062 [Mixed]: output doesn't match +PASS BVTs_bvt062 [Mixed] Stylesheet: MSFT_Conformance_Tests/BVTs/out-cdata.noindent-xsl Data: MSFT_Conformance_Tests/BVTs/data.xml Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt062.saxon @@ -19454,4 +19454,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 2837/3081 tests. +Passed 2837/3081 tests (3 expected failures, 241 unexpected failures). diff --git a/parser.lisp b/parser.lisp index 327a94c..7002401 100644 --- a/parser.lisp +++ b/parser.lisp @@ -64,18 +64,20 @@ (labels ((recurse (i) (when (< i n) (let ((child (stp:nth-child i node))) - (maybe-wrap-namespaces - child - (if (namep child "variable") + (if (namep child "variable") + (maybe-wrap-namespaces + child (only-with-attributes (name select) child (when (and select (stp:list-children child)) (xslt-error "variable with select and body")) `((let ((,name ,(or select `(progn ,@(parse-body child))))) (xsl:with-duplicates-check (,name) - ,@(recurse (1+ i)))))) - (cons (parse-instruction child) - (recurse (1+ i))))))))) + ,@(recurse (1+ i))))))) + (append (maybe-wrap-namespaces + child + (list (parse-instruction child))) + (recurse (1+ i)))))))) (let ((result (recurse start))) (if param-names `((xsl:with-duplicates-check (,@param-names) diff --git a/test.lisp b/test.lisp index 4c4d0b9..201c3f4 100644 --- a/test.lisp +++ b/test.lisp @@ -368,11 +368,13 @@ ;; FIXME? ;; ;; This is an HTML output method issue. The spec says the HTML - ;; output method should output non-HTML elements using the XML output - ;; method. But it doesn't specify the behaviour for HTML elements with - ;; non-HTML attributes on them. We currently output them as HTML, and - ;; lose their namespaces. This test wants the attributes and their - ;; namespaces to survive. + ;; output method should output elements with a null namespace URI as + ;; HTML, and if their name isn't recognized, as an inline element. + ;; here is such an element. It has an attributes with a + ;; namespace though, and the spec doesn't say what we should do with that + ;; attribute. We currently output it using Closure HTML, and + ;; lose its namespace. This test wants the attribute and its + ;; namespace to survive. "BVTs_bvt054")) (defun run-tests (&key filter (directory *tests-directory*)) @@ -485,8 +487,8 @@ (incf known)))))) (t (klacks:skip source :start-element)))) - (format t "~&Passed ~D/~D tests (~D expected failures).~%" pass total known) - (format t "~&Unexpected failures: ~D.~%" (- total pass known)))) + (format t "~&Passed ~D/~D tests (~D expected failures, ~D unexpected failures).~%" + pass total known (- total pass known)))) (defun parse-test () (stp:with-attributes (id category operation -- 2.11.4.GIT