json-to-xml - reflect spec changes
authorMichael Kay <mike@saxonica.com>
Wed, 12 Aug 2015 14:23:07 +0100
changeset 1034 412d4f6bb7bf
parent 1033 82df2f880108
child 1035 beaaed2912d9
json-to-xml - reflect spec changes
tests/fn/json-to-xml/_json-to-xml-test-set.xml
tests/fn/json-to-xml/json-to-xml-A.xsl
tests/fn/json-to-xml/json-to-xml-E.xsl
tests/misc/error/_error-test-set.xml
tests/misc/error/error-3260a.xsl
--- a/tests/fn/json-to-xml/_json-to-xml-test-set.xml	Wed Aug 12 12:36:01 2015 +0100
+++ b/tests/fn/json-to-xml/_json-to-xml-test-set.xml	Wed Aug 12 14:23:07 2015 +0100
@@ -248,6 +248,7 @@
         <description>Escaped quote string - remaining escaped</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Change expected result, quotes not escaped, see bug #28995"/>
         <environment ref="json-to-xml-A"/>
         <test>
             <initial-template name="json-to-xml-escape-003"/>
@@ -255,8 +256,8 @@
         <result>
             <all-of>
                 <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
-                <assert>. = 'Data with \" within it'</assert>
-                <assert>*/@escaped eq "true"</assert>
+                <assert>. = 'Data with " within it'</assert>
+                <!--<assert>*/@escaped eq "true"</assert>-->
                 <any-of>
                     <assert>empty(*/@escaped-key)</assert>
                     <assert>*/@escaped-key eq "false"</assert>
@@ -268,6 +269,7 @@
         <description>Escaped quote string and key - remaining escaped</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Change expected result, quotes not escaped, see bug #28995"/>
         <environment ref="json-to-xml-A"/>
         <test>
             <initial-template name="json-to-xml-escape-004"/>
@@ -275,8 +277,44 @@
         <result>
             <all-of>
                 <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
-                <assert>. = 'Data with \" within it'</assert>
-                <assert>*/@key eq 'Key \" with quote'</assert>
+                <assert>. = 'Data with " within it'</assert>
+                <assert>*/@key eq 'Key " with quote'</assert>
+                <!--<assert>*/@escaped eq "true"</assert>-->
+                <!--<assert>*/@escaped-key eq "true"</assert>-->
+            </all-of>
+        </result>
+    </test-case>
+    <test-case name="json-to-xml-escape-005">
+        <description>Escaped character string - remaining escaped</description>
+        <created by="Debbie Lockett" on="2015-08-12"/>
+        <environment ref="json-to-xml-A"/>
+        <test>
+            <initial-template name="json-to-xml-escape-005"/>
+        </test>
+        <result>
+            <all-of>
+                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
+                <assert>. = 'Data with \f within it'</assert>
+                <assert>*/@escaped eq "true"</assert>
+                <any-of>
+                    <assert>empty(*/@escaped-key)</assert>
+                    <assert>*/@escaped-key eq "false"</assert>
+                </any-of>
+            </all-of>
+        </result>
+    </test-case>
+    <test-case name="json-to-xml-escape-006">
+        <description>Escaped character string and key - remaining escaped</description>
+        <created by="Debbie Lockett" on="2015-08-12"/>
+        <environment ref="json-to-xml-A"/>
+        <test>
+            <initial-template name="json-to-xml-escape-006"/>
+        </test>
+        <result>
+            <all-of>
+                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
+                <assert>. = 'Data with \f within it'</assert>
+                <assert>*/@key eq 'Key \f with special character'</assert>
                 <assert>*/@escaped eq "true"</assert>
                 <assert>*/@escaped-key eq "true"</assert>
             </all-of>
@@ -426,12 +464,13 @@
         <description>Empty string</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-001"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -439,12 +478,13 @@
         <description>Unknown token</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-002"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -452,12 +492,13 @@
         <description>Unknown token</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-003"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -465,12 +506,13 @@
         <description>Extra token</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-004"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -478,12 +520,13 @@
         <description>Non-string key</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-005"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -491,12 +534,13 @@
         <description>Non-string key</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-006"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -504,12 +548,13 @@
         <description>Missing colon after key</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-007"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -517,12 +562,13 @@
         <description>Extra token after map value</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-008"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -530,12 +576,13 @@
         <description>Extra token after array value</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-009"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -543,12 +590,13 @@
         <description>Leading + on number</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-010"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -556,12 +604,13 @@
         <description>Redundant leading 0 on number</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-011"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -569,12 +618,13 @@
         <description>Hex number</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-012"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -582,12 +632,13 @@
         <description>Trailing backslash</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-013"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -595,12 +646,13 @@
         <description>Short unicode</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-014"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -610,12 +662,19 @@
         <modified by="John Lumley" on="2014-07-22"
             change="changed from XTDE3240 to correct error code"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="No longer an error, use default escape=false and replacement char"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-015"/>
         </test>
         <result>
-            <error code="XTDE3250"/>
+            <all-of>
+                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}array)</assert>
+                <assert>. = 'String with &#xFFFD; backspace'</assert>
+                <assert>empty(*/@escaped)</assert>
+                <assert>empty(*/@escaped-key)</assert>
+            </all-of>
+            <!--<error code="XTDE3250"/>-->
         </result>
     </test-case>
 
@@ -623,12 +682,13 @@
         <description>Trailing comma in object</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-016"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -638,13 +698,14 @@
         <modified by="John Lumley" on="2014-07-22"
             change="option 'spec':'liberal' altered to 'liberal':true()"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-017"/>
         </test>
         <result>
             <any-of>
-                <error code="XTDE3240"/>
+                <error code="FOJS0001"/>
                 <assert>/*</assert>
             </any-of>
         </result>
@@ -654,12 +715,13 @@
         <description>Trailing comma in array</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-018"/>
         </test>
         <result>
-            <error code="XTDE3240"/>
+            <error code="FOJS0001"/>
         </result>
     </test-case>
 
@@ -669,13 +731,14 @@
         <modified by="John Lumley" on="2014-07-22"
             change="option 'spec':'liberal' altered to 'liberal':true()"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-019"/>
         </test>
         <result>
             <any-of>
-                <error code="XTDE3240"/>
+                <error code="FOJS0001"/>
                 <assert>/*</assert>
             </any-of>
         </result>
@@ -686,12 +749,13 @@
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="John Lumley" on="2014-07-22" change="option 'spec' altered to 'liberal'"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-020"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
@@ -700,12 +764,13 @@
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="John Lumley" on="2014-07-22" change="option 'spec' altered to 'liberal'"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-021"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
@@ -713,12 +778,13 @@
         <description>Validate option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-022"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
@@ -726,12 +792,13 @@
         <description>Validate option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-023"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
@@ -739,51 +806,55 @@
         <description>Validate option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-024"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
     <test-case name="json-to-xml-error-025">
-        <description>Unescape option error</description>
+        <description>Escape option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape, Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-025"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
     <test-case name="json-to-xml-error-026">
-        <description>Unescape option error</description>
+        <description>Escape option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape, Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-026"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
     <test-case name="json-to-xml-error-027">
-        <description>Unescape option error</description>
+        <description>Escape option error</description>
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape, Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-027"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
@@ -792,12 +863,13 @@
         <created by="John Lumley" on="2013-10-01"/>
         <modified by="Abel Braaksma" on="2014-10-21" change="':=' for maps is replaced by ':'" />
         <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+        <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
         <environment ref="json-to-xml-E"/>
         <test>
             <initial-template name="json-to-xml-error-028"/>
         </test>
         <result>
-            <error code="XTDE3260"/>
+            <error code="XPTY0004"/>
         </result>
     </test-case>
 
--- a/tests/fn/json-to-xml/json-to-xml-A.xsl	Wed Aug 12 12:36:01 2015 +0100
+++ b/tests/fn/json-to-xml/json-to-xml-A.xsl	Wed Aug 12 14:23:07 2015 +0100
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     xmlns:j="http://www.w3.org/2005/xpath-functions">
-    <xsl:param name="options.escape" select="map{'unescape':false()}"/>
+    <xsl:param name="options.escape" select="map{'escape':true()}"/>
     <xsl:param name="options.validate" select="map{'validate':true()}"/>
 
     <!--<xsl:param name="options.rfc" select="map{'spec':'RFC4627'}"/>
@@ -20,6 +20,9 @@
     <xsl:param name="escape.1" select="'[&#34;Data with \&#34; within it&#34;]'"/>
     <xsl:param name="escape.2"
         select="'{&#34;Key \&#34; with quote&#34;:&#34;Data with \&#34; within it&#34;}'"/>
+    <xsl:param name="escape.3" select="'[&#34;Data with \u000C within it&#34;]'"/>
+    <xsl:param name="escape.4"
+        select="'{&#34;Key \u000C with special character&#34;:&#34;Data with \f within it&#34;}'"/>
 
 
     <xsl:template name="json-to-xml-001">
@@ -295,4 +298,46 @@
             </result>
         </xsl:variable>
     </xsl:template>
+    <xsl:template name="json-to-xml-escape-005">
+        <xsl:variable name="metadata">
+            <description>Escaped character string - remaining escaped</description>
+            <created by="Debbie Lockett" on="2015-08-12"/>
+            <environment ref="JSON-XML"/>
+        </xsl:variable>
+        <xsl:copy-of select=" json-to-xml($escape.3,$options.escape)//j:string "/>
+        <xsl:variable name="expected-results">
+            <test> json-to-xml($escape.3,$options.escape)//j:string</test>
+            <result>
+                <!-- <all-of>
+                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
+                <assert>. = 'Data with \f within it'</assert>
+                <assert>*/@escaped eq "true"</assert>
+                <any-of>
+                    <assert>empty(*/@escaped-key)</assert>
+                    <assert>*/@escaped-key eq "false"</assert>
+                </any-of>
+            </all-of>-->
+            </result>
+        </xsl:variable>
+    </xsl:template>
+    <xsl:template name="json-to-xml-escape-006">
+        <xsl:variable name="metadata">
+            <description>Escaped character string and key - remaining escaped</description>
+            <created by="Debbie Lockett" on="2015-08-12"/>
+            <environment ref="JSON-XML"/>
+        </xsl:variable>
+        <xsl:copy-of select=" json-to-xml($escape.4,$options.escape)//j:string "/>
+        <xsl:variable name="expected-results">
+            <test> json-to-xml($escape.4,$options.escape)//j:string</test>
+            <result>
+                <!--<all-of>
+                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
+                <assert>. = 'Data with \f within it'</assert>
+                <assert>*/@key eq 'Key \f with special character'</assert>
+                <assert>*/@escaped eq "true"</assert>
+                <assert>*/@escaped-key eq "true"</assert>
+            </all-of>-->
+            </result>
+        </xsl:variable>
+    </xsl:template>
 </xsl:stylesheet>
--- a/tests/fn/json-to-xml/json-to-xml-E.xsl	Wed Aug 12 12:36:01 2015 +0100
+++ b/tests/fn/json-to-xml/json-to-xml-E.xsl	Wed Aug 12 14:23:07 2015 +0100
@@ -226,28 +226,31 @@
         <xsl:variable name="metadata">
             <description>Unescape option error</description>
             <created by="John Lumley" on="2013-10-01"/>
+            <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape"/>
             <environment ref="JSON-XML"/>
         </xsl:variable>
         <xsl:variable name="json">["String"]</xsl:variable>
-        <xsl:copy-of select="json-to-xml($json, map{'unescape':()})"/>
+        <xsl:copy-of select="json-to-xml($json, map{'escape':()})"/>
     </xsl:template>
     <xsl:template name="json-to-xml-error-026">
         <xsl:variable name="metadata">
-            <description>Unescape option error</description>
+            <description>Escape option error</description>
             <created by="John Lumley" on="2013-10-01"/>
+            <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape"/>
             <environment ref="JSON-XML"/>
         </xsl:variable>
         <xsl:variable name="json">["String"]</xsl:variable>
-        <xsl:copy-of select="json-to-xml($json,map{'unescape':(true(),true())})"/>
+        <xsl:copy-of select="json-to-xml($json,map{'escape':(true(),true())})"/>
     </xsl:template>
     <xsl:template name="json-to-xml-error-027">
         <xsl:variable name="metadata">
-            <description>Unescape option error</description>
+            <description>Escape option error</description>
             <created by="John Lumley" on="2013-10-01"/>
+            <modified by="Debbie Lockett" on="2015-08-12" change="Change keyword unescape->escape"/>
             <environment ref="JSON-XML"/>
         </xsl:variable>
         <xsl:variable name="json">["String"]</xsl:variable>
-        <xsl:copy-of select="json-to-xml($json, map{'unescape':'EMCA-262'})"/>
+        <xsl:copy-of select="json-to-xml($json, map{'escape':'EMCA-262'})"/>
     </xsl:template>
     <xsl:template name="json-to-xml-error-028">
         <xsl:variable name="metadata">
--- a/tests/misc/error/_error-test-set.xml	Wed Aug 12 12:36:01 2015 +0100
+++ b/tests/misc/error/_error-test-set.xml	Wed Aug 12 14:23:07 2015 +0100
@@ -10053,6 +10053,7 @@
       <description>Error: It is a non-recoverable dynamic error if the value of
                $input does not conform to the JSON grammar.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -10061,7 +10062,7 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3240"/>
+         <error code="FOJS0001"/>
       </result>
    </test-case>
 
@@ -10072,6 +10073,7 @@
       </description>
       <created by="Michael Kay" on="2014-08-25"/>
       <modified by="Abel Braaksma" on="2015-04-07" change="Expected error was XTDE3240, but should be XTDE3245 (as in descr of test)" />
+      <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
       <dependencies>
          <spec value="XSLT30+"/>
          <feature value="schema_aware" satisfied="false"/>
@@ -10081,17 +10083,24 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3245"/>
+         <error code="FOJS0004"/>
       </result>
    </test-case>
 
    <test-case name="error-3250a">
-      <description>Error: It is a non-recoverable dynamic
+      <description>Use of the replacement character when $input contains an escaped character
+         which is not valid in the version of XML supported by the implementation, escape=false
+         (by default), and no fallback function is given.
+         
+         Previously:
+         Error: It is a non-recoverable dynamic
                error if the value of
                $input contains an escaped representation of a character (or codepoint)
             that is not a valid character in the version of XML supported by the implementation,
-            unless the unescape option is set to false.</description>
-      <created by="Michael Kay" on="2014-08-25"/>
+            unless the unescape option is set to false.
+      </description>
+      <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Debbie Lockett" on="2015-08-12" change="No longer an error, use default escape=false and replacement char"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -10100,18 +10109,23 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3250"/>
+         <all-of>
+            <assert>out/* instance of element(Q{http://www.w3.org/2005/xpath-functions}array)</assert>
+            <assert>out//Q{http://www.w3.org/2005/xpath-functions}string = 'xx&#xFFFD;xx'</assert>
+         </all-of>
+         <!--<error code="XTDE3250"/>-->
       </result>
    </test-case>
 
    <test-case name="error-3255a">
       <description>Error: It is a dynamic error if the value of
                   $options includes an entry whose key is indent, 
-                     validate, unescape, or fallback,
+                     validate, escape, or fallback,
                      and whose value is not a permitted value for that key.</description>
       <created by="Michael Kay" on="2014-08-25"/>
       <modified by="Abel Braaksma" on="2015-04-07" change="Fixed typo, as='element' into as='element()'"/>
       <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+      <modified by="Debbie Lockett" on="2015-08-12" change="Error code change - the value is the wrong type"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -10120,17 +10134,18 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3255"/>
+         <error code="XPTY0004"/>
       </result>
    </test-case>
 
    <test-case name="error-3260a">
       <description>Error: It is a non-recoverable dynamic
                error if the value of
-            $options includes an entry whose key is "spec" and whose value is not
-            a single xs:string, or an entry whose key is "unescape" and whose value
+               $options includes an entry whose key is "liberal" and whose value is not
+               a single xs:boolean, or an entry whose key is "escape" and whose value
             is not a single xs:boolean.</description>
       <created by="Michael Kay" on="2014-08-25"/>
+      <modified by="Debbie Lockett" on="2015-08-12" change="Error code change; change keywords unescape->escape, spec->liberal"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -10139,7 +10154,7 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3260"/>
+         <error code="XPTY0004"/>
       </result>
    </test-case>
 
@@ -10150,6 +10165,7 @@
       <created by="Michael Kay" on="2014-08-25"/>
       <modified by="Abel Braaksma" on="2015-04-07" change="Fixed typo, as='element' into as='element()'"/>
       <modified by="Michael Kay" on="2015-06-23" change="Namespace change resulting from bug 28174"/>
+      <modified by="Debbie Lockett" on="2015-08-12" change="Error code change"/>
       <dependencies>
          <spec value="XSLT30+"/>
       </dependencies>
@@ -10158,7 +10174,7 @@
          <initial-template name="main"/>
       </test>
       <result>
-         <error code="XTDE3265"/>
+         <error code="FOJS0006"/>
       </result>
    </test-case>
 
--- a/tests/misc/error/error-3260a.xsl	Wed Aug 12 12:36:01 2015 +0100
+++ b/tests/misc/error/error-3260a.xsl	Wed Aug 12 14:23:07 2015 +0100
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"><!--It is a non-recoverable dynamic
                error if the value of
-            $options includes an entry whose key is "spec" and whose value is not
-            a single xs:string, or an entry whose key is "unescape" and whose value
+            $options includes an entry whose key is "liberal" and whose value is not
+            a single xs:boolean, or an entry whose key is "escape" and whose value
             is not a single xs:boolean.-->
    <xsl:template name="main">
       <out>