From c7778d21a6cb4f61412d8b06f8e51ef33b8d15ff Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Mon, 24 Mar 2008 17:46:55 +0100 Subject: [PATCH] Comment recovery --- TEST | 65 +++++++++++------------------------------------------------- test.lisp | 6 ++++++ unparse.lisp | 1 + 3 files changed, 19 insertions(+), 53 deletions(-) diff --git a/TEST b/TEST index 61ee137..d3f9fd2 100644 --- a/TEST +++ b/TEST @@ -6652,17 +6652,6 @@ PASS output_output74 [XSLT-Result-Tree] Expected output (1): Xalan_Conformance_Tests/output/output_output74.saxon Actual output: Xalan_Conformance_Tests/output/output_output74.xuriella -WARNING: - comparison failed: Document not well-formed: Expected '!' or '?' after '<' in DTD. -Context: - Line 6, column 9 in NIL - -FAIL output_output75 [XSLT-Result-Tree]: saxon error not signalled and official output not a match - Stylesheet: Xalan_Conformance_Tests/output/output75.noindent-xsl - Data: Xalan_Conformance_Tests/output/output75.xml - Expected output (1): Xalan_Conformance_Tests/output/output_output75.saxon - Actual output: Xalan_Conformance_Tests/output/output_output75.xuriella - PASS output_output76 [XSLT-Result-Tree] Stylesheet: Xalan_Conformance_Tests/output/output76.noindent-xsl Data: Xalan_Conformance_Tests/output/output76.xml @@ -6731,17 +6720,7 @@ PASS output_output88 [XSLT-Result-Tree] Expected output (1): Xalan_Conformance_Tests/output/output_output88.saxon Actual output: Xalan_Conformance_Tests/output/output_output88.xuriella -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 3, column 39 in NIL - -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 3, column 39 in NIL - -FAIL output_output89 [XSLT-Result-Tree]: output doesn't match +PASS output_output89 [XSLT-Result-Tree] Stylesheet: Xalan_Conformance_Tests/output/output89.noindent-xsl Data: Xalan_Conformance_Tests/output/output89.xml Expected output (1): Xalan_Conformance_Tests/output/output_output89.saxon @@ -13044,7 +13023,7 @@ PASS BVTs_bvt100 [Mixed] Expected output (1): MSFT_Conformance_Tests/BVTs/BVTs_bvt100.saxon Actual output: MSFT_Conformance_Tests/BVTs/BVTs_bvt100.xuriella -FAIL Comment_Comment_CDATAWithDoubleHyphen [XSLT-Result-Tree]: output doesn't match +PASS Comment_Comment_CDATAWithDoubleHyphen [XSLT-Result-Tree] Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_CdataHyphen.noindent-xsl Data: MSFT_Conformance_Tests/Comment/xslt_comment_root.xml Expected output (1): MSFT_Conformance_Tests/Comment/Comment_Comment_CDATAWithDoubleHyphen.saxon @@ -13059,12 +13038,12 @@ PASS Comment_Comment_CDATAWithDoubleHyphenEntities [XSLT-Result-Tree] WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_CDATAWithSingleHyphen.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_CDATAWithSingleHyphen.xuriella WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_CDATAWithSingleHyphen.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_CDATAWithSingleHyphen.xuriella FAIL Comment_Comment_CDATAWithSingleHyphen [XSLT-Result-Tree]: output doesn't match Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_CdataHyphenEntityMix.noindent-xsl @@ -13106,17 +13085,7 @@ FAIL Comment_Comment_DoubleHypenEntitywithDelCharacter [XSLT-Result-Tree]: outpu Expected output (1): MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHypenEntitywithDelCharacter.saxon Actual output: MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHypenEntitywithDelCharacter.xuriella -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 1, column 13 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHypenInText.xuriella - -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 1, column 13 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHypenInText.xuriella - -FAIL Comment_Comment_DoubleHypenInText [XSLT-Result-Tree]: output doesn't match +PASS Comment_Comment_DoubleHypenInText [XSLT-Result-Tree] Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_DoubleHyphen.noindent-xsl Data: MSFT_Conformance_Tests/Comment/xslt_comment_root.xml Expected output (1): MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHypenInText.saxon @@ -13125,12 +13094,12 @@ FAIL Comment_Comment_DoubleHypenInText [XSLT-Result-Tree]: output doesn't match WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHyphenONLY.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHyphenONLY.xuriella WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHyphenONLY.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_DoubleHyphenONLY.xuriella FAIL Comment_Comment_DoubleHyphenONLY [XSLT-Result-Tree]: output doesn't match Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_DoubleHyphenOnly.noindent-xsl @@ -13144,17 +13113,7 @@ PASS Comment_Comment_EmptyComment [XSLT-Result-Tree] Expected output (1): MSFT_Conformance_Tests/Comment/Comment_Comment_EmptyComment.saxon Actual output: MSFT_Conformance_Tests/Comment/Comment_Comment_EmptyComment.xuriella -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 1, column 12 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_HyphenEntityAndHyphen.xuriella - -WARNING: - comparison failed: Document not well-formed: '--' not allowed in a comment -Location: - Line 1, column 12 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_HyphenEntityAndHyphen.xuriella - -FAIL Comment_Comment_HyphenEntityAndHyphen [XSLT-Result-Tree]: output doesn't match +PASS Comment_Comment_HyphenEntityAndHyphen [XSLT-Result-Tree] Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_DoubleHyphenEntity.noindent-xsl Data: MSFT_Conformance_Tests/Comment/xslt_comment_root.xml Expected output (1): MSFT_Conformance_Tests/Comment/Comment_Comment_HyphenEntityAndHyphen.saxon @@ -13163,12 +13122,12 @@ FAIL Comment_Comment_HyphenEntityAndHyphen [XSLT-Result-Tree]: output doesn't ma WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_LineOfAllHyphens.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_LineOfAllHyphens.xuriella WARNING: comparison failed: Document not well-formed: '--' not allowed in a comment Location: - Line 1, column 8 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_LineOfAllHyphens.xuriella + Line 1, column 10 in file://+...MSFT_Conformance_Tests/Comment/Comment_Comment_LineOfAllHyphens.xuriella FAIL Comment_Comment_LineOfAllHyphens [XSLT-Result-Tree]: output doesn't match Stylesheet: MSFT_Conformance_Tests/Comment/xslt_comment_LineOfHyphens.noindent-xsl @@ -21371,7 +21330,7 @@ PASS Text_Text_ConvCdataLitResultTextOnly [XSLT-Result-Tree] Expected output (1): MSFT_Conformance_Tests/Text/Text_Text_ConvCdataLitResultTextOnly.saxon Actual output: MSFT_Conformance_Tests/Text/Text_Text_ConvCdataLitResultTextOnly.xuriella -FAIL Value-of_DisableOutputEscaping_XslValueOfInXslComment [XSLT-Result-Tree]: saxon error not signalled and official output not a match +PASS Value-of_DisableOutputEscaping_XslValueOfInXslComment [XSLT-Result-Tree] Stylesheet: MSFT_Conformance_Tests/Valueof/xslt_valueof_DoeValueOfInComment.noindent-xsl Data: MSFT_Conformance_Tests/Valueof/xslt_valueof_DoeValueOfInComment.xml Expected output (1): MSFT_Conformance_Tests/Valueof/Value-of_DisableOutputEscaping_XslValueOfInXslComment.saxon @@ -22662,4 +22621,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 2685/3077 tests. +Passed 2690/3076 tests. diff --git a/test.lisp b/test.lisp index 54d20fb..ebacf55 100644 --- a/test.lisp +++ b/test.lisp @@ -303,11 +303,17 @@ "copy_copy61" "copy_copy62" + ;; we perform recovery, but saxon doesn't. Recovery results in non-XML + ;; output, which we can't parse for comparison against the official test + ;; case. + "output_output75" + ;; we'd pass these tests, but the test authors forgot to declare the ;; entity they're writing, so we can't parse it for comparison. "output_output06" "output_output10" "output_output61" + ;; another similar test where the output is unparsable, except that ;; here an entity declaration wouldn't have helped either: "Copying_ResultTreeFragmentWithEscapedText" diff --git a/unparse.lisp b/unparse.lisp index a1cdc3a..a1ed35f 100644 --- a/unparse.lisp +++ b/unparse.lisp @@ -311,6 +311,7 @@ (defun write-comment (data) (maybe-emit-start-tag) + (setf data (cl-ppcre:regex-replace-all "--" data "- -")) (sax:comment *sink* data) data) -- 2.11.4.GIT