From 82a0f7a09f531573e0b078c953282a5006f44a86 Mon Sep 17 00:00:00 2001 From: Debbie Lockett Date: Fri, 29 Nov 2019 14:34:12 +0000 Subject: [PATCH] New test suite dependencies to better handle HTML versions (support and default) for serialized output; + new tests for serialization edge cases --- admin/catalog-schema.xsd | 24 +++ .../character-map/_character-map-test-set.xml | 26 ++- .../decl/character-map/character-map-028.xsl | 16 ++ tests/decl/output/_output-test-set.xml | 173 +++++++++++++++++- tests/decl/output/output-0115b.xsl | 19 ++ tests/decl/output/output-0115c.xsl | 24 +++ tests/decl/output/output-0115d.xsl | 20 ++ tests/decl/output/output-0115e.xsl | 20 ++ tests/decl/output/output-0195b.xsl | 10 + .../_result-document-test-set.xml | 42 ++++- .../result-document/result-document-1411.xsl | 25 +++ 11 files changed, 391 insertions(+), 8 deletions(-) create mode 100644 tests/decl/character-map/character-map-028.xsl create mode 100644 tests/decl/output/output-0115b.xsl create mode 100644 tests/decl/output/output-0115c.xsl create mode 100644 tests/decl/output/output-0115d.xsl create mode 100644 tests/decl/output/output-0115e.xsl create mode 100644 tests/decl/output/output-0195b.xsl create mode 100644 tests/insn/result-document/result-document-1411.xsl diff --git a/admin/catalog-schema.xsd b/admin/catalog-schema.xsd index ee93f71d4..edddec312 100755 --- a/admin/catalog-schema.xsd +++ b/admin/catalog-schema.xsd @@ -881,6 +881,8 @@ + + @@ -1281,6 +1283,28 @@ + + + +

Identifies the default HTML version for serialized output.

+
+
+ + + + + + + + + + + + + + +
+ diff --git a/tests/decl/character-map/_character-map-test-set.xml b/tests/decl/character-map/_character-map-test-set.xml index 28d04e181..9eb2bab88 100644 --- a/tests/decl/character-map/_character-map-test-set.xml +++ b/tests/decl/character-map/_character-map-test-set.xml @@ -511,6 +511,7 @@ Test that characters produced by a character map are immune to Unicode normalization single-character-map xml-output-method + @@ -520,11 +521,11 @@ - + - - <out>ab#ç#c.de</out> - + <out>ab#ç#çde</out> + <out>ab#ç#çde</out> + @@ -563,4 +564,21 @@ + + + Test that characters produced by a character map are immune to Unicode normalization + single-character-map xml-output-method + + + + + + + + + + + <out att=['"]ab#ç#çde['"]>ab#ç#çde</out> + + diff --git a/tests/decl/character-map/character-map-028.xsl b/tests/decl/character-map/character-map-028.xsl new file mode 100644 index 000000000..f6d76ccab --- /dev/null +++ b/tests/decl/character-map/character-map-028.xsl @@ -0,0 +1,16 @@ + + + + + + + + + + + + + abcçde + + + \ No newline at end of file diff --git a/tests/decl/output/_output-test-set.xml b/tests/decl/output/_output-test-set.xml index fb4f6dbc3..042959482 100644 --- a/tests/decl/output/_output-test-set.xml +++ b/tests/decl/output/_output-test-set.xml @@ -198,6 +198,7 @@ @escape-uri-attributes=yes. + @@ -207,7 +208,10 @@ - + + + + @@ -256,6 +260,7 @@ @escape-uri-attributes=no. + @@ -265,7 +270,10 @@ - + + + + @@ -276,6 +284,7 @@ + @@ -288,6 +297,7 @@ + @@ -315,6 +325,7 @@ @escape-uri-attributes=no. + @@ -324,7 +335,10 @@ - + + + + @@ -680,6 +694,113 @@ + + + Test XHTML output with cdata-section-elements that have (non-ASCII) characters + not representable in the character encoding being used for output (US-ASCII) + + + + + + + + + + + + + ]]> + <!\[CDATA\[foo \]\]> + <!\[CDATA\[ bar\]\]> + + ª<]]> + ª<]]> + + + + + + + Test XHTML output with cdata-section-elements that have (non-ASCII) characters + not representable in the character encoding being used for output (US-ASCII); + not affected by character maps + + + + + + + + + + + + + ]]> + <!\[CDATA\[foo \]\]> + <!\[CDATA\[ bar\]\]> + + ª<]]> + ª<]]> + + + + + + + Test XHTML output with cdata-section-elements that have (non-ASCII) characters + not representable in the character encoding being used for output (US-ASCII); + but unicode normalized (NFD) + + + + + + + + + + + + + ]]> + <!\[CDATA\[foo c\]\]> + <!\[CDATA\[ bar\]\]> + + ̧<]]> + ̧<]]> + + + + + + + Test XHTML output with cdata-section-elements that have (non-ASCII) characters + not representable in the character encoding being used for output (US-ASCII); + but unicode normalized (NFC) + + + + + + + + + + + + + ]]> + <!\[CDATA\[foo \]\]> + <!\[CDATA\[ bar\]\]> + + ç<]]> + ç<]]> + + + + Test empty elements with empty content model in XHTML output and @@ -2672,9 +2793,12 @@ + + + @@ -2684,6 +2808,49 @@ + + + Test that no error is raised if the output method is HTML, with default version 5.0, and the result tree + contains characters in the #x7F-#x9F range. + + + + + + + + + + + + + + Ÿ]]> + Ÿ]]> + + + + + + Test that no error is raised if the output method is HTML, version 5.0, and the result tree + contains characters in the #x7F-#x9F range. + + + + + + + + + + + + + Ÿ]]> + Ÿ]]> + + + Test that an error is raised if the output method is HTML and > appears within diff --git a/tests/decl/output/output-0115b.xsl b/tests/decl/output/output-0115b.xsl new file mode 100644 index 000000000..61483b1d2 --- /dev/null +++ b/tests/decl/output/output-0115b.xsl @@ -0,0 +1,19 @@ + + + + + + + + + + foo ª bar + + + + diff --git a/tests/decl/output/output-0115c.xsl b/tests/decl/output/output-0115c.xsl new file mode 100644 index 000000000..0e7cd44ed --- /dev/null +++ b/tests/decl/output/output-0115c.xsl @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + foo ª bar + + + + diff --git a/tests/decl/output/output-0115d.xsl b/tests/decl/output/output-0115d.xsl new file mode 100644 index 000000000..fc92db279 --- /dev/null +++ b/tests/decl/output/output-0115d.xsl @@ -0,0 +1,20 @@ + + + + + + + + + + foo ç bar + + + + diff --git a/tests/decl/output/output-0115e.xsl b/tests/decl/output/output-0115e.xsl new file mode 100644 index 000000000..2525a9496 --- /dev/null +++ b/tests/decl/output/output-0115e.xsl @@ -0,0 +1,20 @@ + + + + + + + + + + foo ç bar + + + + diff --git a/tests/decl/output/output-0195b.xsl b/tests/decl/output/output-0195b.xsl new file mode 100644 index 000000000..2bef6ed54 --- /dev/null +++ b/tests/decl/output/output-0195b.xsl @@ -0,0 +1,10 @@ + + + + + + + + Ÿ + + diff --git a/tests/insn/result-document/_result-document-test-set.xml b/tests/insn/result-document/_result-document-test-set.xml index 431797b50..9c2983bb6 100755 --- a/tests/insn/result-document/_result-document-test-set.xml +++ b/tests/insn/result-document/_result-document-test-set.xml @@ -776,10 +776,12 @@ the un-named xsl:format (i.e. no 'name' attribute) has method "text". + + @@ -2934,9 +2936,30 @@ the un-named xsl:format (i.e. no 'name' attribute) has method "text".JSON serialization with nested HTML + + + + + + + + + + <\\/meta>Document 1<\\/title>]]></serialization-matches> + </result> + </test-case> + + <test-case name="result-document-1402b"> + <description>JSON serialization with nested HTML, with default version 5.0</description> + <created by="Debbie Lockett" on="2019-11-29"/> + <dependencies> + <spec value="XSLT30+"/> + <feature value="serialization" satisfied="true"/> + <feature value="HTML5"/> + <default_html_version value="5"/> </dependencies> <test> <stylesheet file="result-document-1402.xsl"/> @@ -2944,7 +2967,8 @@ the un-named xsl:format (i.e. no 'name' attribute) has method "text".</assert-se </test> <result> <all-of> - <serialization-matches><![CDATA["doc1":"<html xmlns=\\"http:\\/\\/www.w3.org\\/1999\\/xhtml\\"><head><meta http-equiv=\\"Content-Type\\" content=\\"text\\/html; charset=UTF-8\\"><\\/meta><title>Document 1<\\/title>]]></serialization-matches> + <serialization-matches><![CDATA["doc1":"<]]></serialization-matches> + <serialization-matches><![CDATA[<html xmlns=\\"http:\\/\\/www.w3.org\\/1999\\/xhtml\\"><head><meta http-equiv=\\"Content-Type\\" content=\\"text\\/html; charset=UTF-8\\"><title>Document 1<\\/title>]]></serialization-matches> </all-of> </result> </test-case> @@ -3096,6 +3120,22 @@ the un-named xsl:format (i.e. no 'name' attribute) has method "text".</assert-se </result> </test-case> + <test-case name="result-document-1411"> + <description>JSON serialization parameter document and character map</description> + <created by="Debbie Lockett" on="2019-11-29"/> + <dependencies> + <spec value="XSLT30+"/> + <feature value="serialization" satisfied="true"/> + </dependencies> + <test> + <stylesheet file="result-document-1411.xsl"/> + <output serialize="yes" tree="no"/> + </test> + <result> + <serialization-matches>\{"AAA":"AAA","BBB":"BBB","CCC":"CCC","d":"DDD","e":"EEE","f":"FFF","g":"GGG"\}</serialization-matches> + </result> + </test-case> + <test-case name="result-document-1501"> <description>xsl:result-document within xsl:analyze-string</description> <created by="Michael Kay" on="2016-12-21"/> diff --git a/tests/insn/result-document/result-document-1411.xsl b/tests/insn/result-document/result-document-1411.xsl new file mode 100644 index 000000000..e535b1e55 --- /dev/null +++ b/tests/insn/result-document/result-document-1411.xsl @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:transform xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:my="http://example.com" + version="3.0"> + + <xsl:output name="my:format-1406" parameter-document="result-document-1406-params.xml" build-tree="no"/> + + <xsl:param name="o" select="'1406'"/> + + <!-- Purpose: Test serialization with parameter document --> + + <xsl:template name="xsl:initial-template"> + <xsl:result-document format="my:format-{$o}"> + <xsl:map> + <xsl:map-entry key="'a'" select="'AAA'"/> + <xsl:map-entry key="'b'" select="'BBB'"/> + <xsl:map-entry key="'c'" select="'CCC'"/> + <xsl:map-entry key="'d'" select="'DDD'"/> + <xsl:map-entry key="'e'" select="'EEE'"/> + <xsl:map-entry key="'f'" select="'FFF'"/> + <xsl:map-entry key="'g'" select="'GGG'"/> + </xsl:map> + </xsl:result-document> + </xsl:template> +</xsl:transform>