From 443b0fca420ff07c39ff1c284d0f29db76d40837 Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Sun, 20 Apr 2008 22:22:47 +0200 Subject: [PATCH] Parse output/@cdata-section-elements (still not implemented though) --- TEST | 10 ++++------ xslt.lisp | 44 +++++++++++++++++++++++--------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/TEST b/TEST index c6b6d64..56c6ec5 100644 --- a/TEST +++ b/TEST @@ -12767,7 +12767,7 @@ PASS Errors_err071 [Mixed]: raised an xslt-error as expected Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err071.saxon Actual output: MSFT_Conformance_Tests/Errors/Errors_err071.xuriella -FAIL Errors_err072 [Mixed]: expected error not signalled: +PASS Errors_err072 [Mixed]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Errors/out-badcdata.noindent-xsl Data: MSFT_Conformance_Tests/Errors/data.xml Expected output (1): MSFT_Conformance_Tests/Errors/Errors_err072.saxon @@ -15811,7 +15811,7 @@ FAIL Output__77966 [XSLT-Output]: expected error not signalled: Expected output (1): MSFT_Conformance_Tests/Output/Output__77966.saxon Actual output: MSFT_Conformance_Tests/Output/Output__77966.xuriella -FAIL Output__77967 [XSLT-Output]: expected error not signalled: +PASS Output__77967 [XSLT-Output]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Output/xslt29601.noindent-xsl Data: MSFT_Conformance_Tests/Output/books.xml Expected output (1): MSFT_Conformance_Tests/Output/Output__77967.saxon @@ -16007,9 +16007,7 @@ error opening #P"...MSFT_Conformance_Tests/Output/OutputText.xml": Expected output (1): MSFT_Conformance_Tests/Output/Output__84012.saxon Actual output: MSFT_Conformance_Tests/Output/Output__84012.xuriella -FAIL Output__84013 [XSLT-Output]: condition of incorrect type: -error opening #P"...MSFT_Conformance_Tests/Output/OutputText.xml": - No such file or directory +PASS Output__84013 [XSLT-Output]: raised an xslt-error as expected Stylesheet: MSFT_Conformance_Tests/Output/84013.noindent-xsl Data: MSFT_Conformance_Tests/Output/OutputText.xml Expected output (1): MSFT_Conformance_Tests/Output/Output__84013.saxon @@ -19415,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 2891/3080 tests (3 expected failures, 186 unexpected failures). +Passed 2894/3080 tests (3 expected failures, 183 unexpected failures). diff --git a/xslt.lisp b/xslt.lisp index d5b6b3f..ef9e4d7 100644 --- a/xslt.lisp +++ b/xslt.lisp @@ -623,7 +623,7 @@ (funcall var-cont) (parse-keys! stylesheet env) (parse-templates! stylesheet env) - (parse-output! stylesheet ) + (parse-output! stylesheet env) (parse-strip/preserve-space! stylesheet env) (parse-attribute-sets! stylesheet env) (parse-namespace-aliases! stylesheet env) @@ -907,23 +907,27 @@ omit-xml-declaration encoding doctype-system - doctype-public) + doctype-public + cdata-section-matchers) -(defun parse-output! (stylesheet ) +(defun parse-output! (stylesheet env) (dolist ( (list-toplevel "output" )) (let ((spec (stylesheet-output-specification stylesheet))) - (stp:with-attributes ( ;; version - method - indent - encoding -;;; media-type - doctype-system - doctype-public - omit-xml-declaration -;;; standalone -;;; cdata-section-elements - ) + (only-with-attributes (version + method + indent + encoding + media-type + doctype-system + doctype-public + omit-xml-declaration + standalone + cdata-section-elements) + (declare (ignore version + ;; FIXME: + media-type + standalone)) (when method (setf (output-method spec) method)) (when indent @@ -936,13 +940,11 @@ (setf (output-doctype-public spec) doctype-public)) (when omit-xml-declaration (setf (output-omit-xml-declaration spec) omit-xml-declaration)) -;;; (when cdata-section-elements -;;; (setf (output-cdata-section-elements spec) -;;; (concatenate 'string -;;; (output-cdata-section-elements spec) -;;; " " -;;; cdata-section-elements))) - )))) + (when cdata-section-elements + (dolist (qname (words cdata-section-elements)) + (decode-qname qname env nil) ;check the syntax + (push (xpath:make-pattern-matcher* qname env) + (output-cdata-section-matchers spec)))))))) (defun make-empty-declaration-array () (make-array 1 :fill-pointer 0 :adjustable t)) -- 2.11.4.GIT