tests/fn/json-to-xml/json-to-xml-A.xsl
changeset 1034 412d4f6bb7bf
parent 990 32ad9ac3c0e5
child 1106 482871e299f2
equal deleted inserted replaced
1033:82df2f880108 1034:412d4f6bb7bf
     1 <?xml version="1.0" encoding="UTF-8"?>
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     2 <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     3     xmlns:j="http://www.w3.org/2005/xpath-functions">
     3     xmlns:j="http://www.w3.org/2005/xpath-functions">
     4     <xsl:param name="options.escape" select="map{'unescape':false()}"/>
     4     <xsl:param name="options.escape" select="map{'escape':true()}"/>
     5     <xsl:param name="options.validate" select="map{'validate':true()}"/>
     5     <xsl:param name="options.validate" select="map{'validate':true()}"/>
     6 
     6 
     7     <!--<xsl:param name="options.rfc" select="map{'spec':'RFC4627'}"/>
     7     <!--<xsl:param name="options.rfc" select="map{'spec':'RFC4627'}"/>
     8     <xsl:param name="options.ecma" select="map{'spec':'ECMA-262'}"/>-->
     8     <xsl:param name="options.ecma" select="map{'spec':'ECMA-262'}"/>-->
     9 
     9 
    18     <xsl:param name="s2" select="'{&#34;x&#34;:1, &#34;y&#34;:[1,2,3]}'"/>
    18     <xsl:param name="s2" select="'{&#34;x&#34;:1, &#34;y&#34;:[1,2,3]}'"/>
    19 
    19 
    20     <xsl:param name="escape.1" select="'[&#34;Data with \&#34; within it&#34;]'"/>
    20     <xsl:param name="escape.1" select="'[&#34;Data with \&#34; within it&#34;]'"/>
    21     <xsl:param name="escape.2"
    21     <xsl:param name="escape.2"
    22         select="'{&#34;Key \&#34; with quote&#34;:&#34;Data with \&#34; within it&#34;}'"/>
    22         select="'{&#34;Key \&#34; with quote&#34;:&#34;Data with \&#34; within it&#34;}'"/>
       
    23     <xsl:param name="escape.3" select="'[&#34;Data with \u000C within it&#34;]'"/>
       
    24     <xsl:param name="escape.4"
       
    25         select="'{&#34;Key \u000C with special character&#34;:&#34;Data with \f within it&#34;}'"/>
    23 
    26 
    24 
    27 
    25     <xsl:template name="json-to-xml-001">
    28     <xsl:template name="json-to-xml-001">
    26         <xsl:variable name="metadata">
    29         <xsl:variable name="metadata">
    27             <description>Empty object as document-node</description>
    30             <description>Empty object as document-node</description>
   293                     <assert>$result/@escaped-key eq "true"</assert>
   296                     <assert>$result/@escaped-key eq "true"</assert>
   294                 </all-of>-->
   297                 </all-of>-->
   295             </result>
   298             </result>
   296         </xsl:variable>
   299         </xsl:variable>
   297     </xsl:template>
   300     </xsl:template>
       
   301     <xsl:template name="json-to-xml-escape-005">
       
   302         <xsl:variable name="metadata">
       
   303             <description>Escaped character string - remaining escaped</description>
       
   304             <created by="Debbie Lockett" on="2015-08-12"/>
       
   305             <environment ref="JSON-XML"/>
       
   306         </xsl:variable>
       
   307         <xsl:copy-of select=" json-to-xml($escape.3,$options.escape)//j:string "/>
       
   308         <xsl:variable name="expected-results">
       
   309             <test> json-to-xml($escape.3,$options.escape)//j:string</test>
       
   310             <result>
       
   311                 <!-- <all-of>
       
   312                 <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
       
   313                 <assert>. = 'Data with \f within it'</assert>
       
   314                 <assert>*/@escaped eq "true"</assert>
       
   315                 <any-of>
       
   316                     <assert>empty(*/@escaped-key)</assert>
       
   317                     <assert>*/@escaped-key eq "false"</assert>
       
   318                 </any-of>
       
   319             </all-of>-->
       
   320             </result>
       
   321         </xsl:variable>
       
   322     </xsl:template>
       
   323     <xsl:template name="json-to-xml-escape-006">
       
   324         <xsl:variable name="metadata">
       
   325             <description>Escaped character string and key - remaining escaped</description>
       
   326             <created by="Debbie Lockett" on="2015-08-12"/>
       
   327             <environment ref="JSON-XML"/>
       
   328         </xsl:variable>
       
   329         <xsl:copy-of select=" json-to-xml($escape.4,$options.escape)//j:string "/>
       
   330         <xsl:variable name="expected-results">
       
   331             <test> json-to-xml($escape.4,$options.escape)//j:string</test>
       
   332             <result>
       
   333                 <!--<all-of>
       
   334                 <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
       
   335                 <assert>. = 'Data with \f within it'</assert>
       
   336                 <assert>*/@key eq 'Key \f with special character'</assert>
       
   337                 <assert>*/@escaped eq "true"</assert>
       
   338                 <assert>*/@escaped-key eq "true"</assert>
       
   339             </all-of>-->
       
   340             </result>
       
   341         </xsl:variable>
       
   342     </xsl:template>
   298 </xsl:stylesheet>
   343 </xsl:stylesheet>