tests/fn/json-to-xml/json-to-xml-A.xsl
author Michael Kay <mike@saxonica.com>
Wed, 12 Aug 2015 14:23:07 +0100
changeset 1034 412d4f6bb7bf
parent 990 32ad9ac3c0e5
child 1106 482871e299f2
permissions -rw-r--r--
json-to-xml - reflect spec changes
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     2
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
     3
    xmlns:j="http://www.w3.org/2005/xpath-functions">
1034
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
     4
    <xsl:param name="options.escape" select="map{'escape':true()}"/>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     5
    <xsl:param name="options.validate" select="map{'validate':true()}"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     6
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     7
    <!--<xsl:param name="options.rfc" select="map{'spec':'RFC4627'}"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     8
    <xsl:param name="options.ecma" select="map{'spec':'ECMA-262'}"/>-->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
     9
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    10
    <xsl:param name="s0.map" select="'{}'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    11
    <xsl:param name="s0.array" select="'[]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    12
    <xsl:param name="s1.number" select="'[1]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    13
    <xsl:param name="s1.string" select="'[&#34;a&#34;]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    14
    <xsl:param name="s1.true" select="'[true]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    15
    <xsl:param name="s1.false" select="'[false]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    16
    <xsl:param name="s1.null" select="'[null]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    17
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    18
    <xsl:param name="s2" select="'{&#34;x&#34;:1, &#34;y&#34;:[1,2,3]}'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    19
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    20
    <xsl:param name="escape.1" select="'[&#34;Data with \&#34; within it&#34;]'"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    21
    <xsl:param name="escape.2"
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    22
        select="'{&#34;Key \&#34; with quote&#34;:&#34;Data with \&#34; within it&#34;}'"/>
1034
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
    23
    <xsl:param name="escape.3" select="'[&#34;Data with \u000C within it&#34;]'"/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
    24
    <xsl:param name="escape.4"
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
    25
        select="'{&#34;Key \u000C with special character&#34;:&#34;Data with \f within it&#34;}'"/>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    26
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    27
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    28
    <xsl:template name="json-to-xml-001">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    29
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    30
            <description>Empty object as document-node</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    31
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    32
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    33
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    34
        <xsl:copy-of select=" json-to-xml($s0.map) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    35
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    36
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    37
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    38
                <assert-type>document-node()</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    39
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    40
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    41
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    42
    <xsl:template name="json-to-xml-002">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    43
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    44
            <description>Empty object</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    45
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    46
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    47
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    48
        <xsl:copy-of select=" json-to-xml($s0.map) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    49
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    50
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    51
                <assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
    52
                <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}map)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    53
                <assert>count($result/*) eq 0</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    54
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    55
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    56
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    57
    <xsl:template name="json-to-xml-003">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    58
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    59
            <description>Empty array as document-node</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    60
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    61
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    62
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    63
        <xsl:copy-of select=" json-to-xml($s0.array) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    64
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    65
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    66
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    67
                <assert-type>document-node()</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    68
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    69
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    70
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    71
    <xsl:template name="json-to-xml-004">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    72
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    73
            <description>Empty array</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    74
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    75
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    76
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    77
        <xsl:copy-of select=" json-to-xml($s0.array) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    78
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    79
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    80
                <assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
    81
                <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}array)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    82
                <assert>count($result/*) eq 0</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    83
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    84
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    85
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    86
    <xsl:template name="json-to-xml-005">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    87
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    88
            <description>Array Number</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    89
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    90
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    91
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    92
        <xsl:copy-of select=" json-to-xml($s1.number) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    93
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    94
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    95
                <assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
    96
                <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}array)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    97
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    98
                <assert>$result/*[1] instance of element(j:number,xs:untyped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
    99
                <assert>xs:double($result/*[1]) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   100
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   101
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   102
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   103
    <xsl:template name="json-to-xml-006">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   104
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   105
            <description>Array String</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   106
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   107
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   108
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   109
        <xsl:copy-of select=" json-to-xml($s1.string) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   110
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   111
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   112
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   113
                <assert-type>element(*)</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   114
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   115
                <assert>$result/*[1] instance of element(j:string,xs:untyped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   116
                <assert>xs:string($result/*[1]) eq "a"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   117
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   118
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   119
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   120
    <xsl:template name="json-to-xml-007">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   121
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   122
            <description>Array True</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   123
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   124
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   125
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   126
        <xsl:copy-of select=" json-to-xml($s1.true) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   127
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   128
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   129
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   130
                <assert-type>element(*)</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   131
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   132
                <assert>$result/*[1] instance of element(j:boolean,xs:untyped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   133
                <assert>xs:boolean($result/*[1]) eq true()</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   134
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   135
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   136
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   137
    <xsl:template name="json-to-xml-008">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   138
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   139
            <description>Array False</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   140
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   141
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   142
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   143
        <xsl:copy-of select=" json-to-xml($s1.false) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   144
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   145
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   146
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   147
                <assert-type>element(*)</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   148
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   149
                <assert>$result/*[1] instance of element(j:boolean,xs:untyped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   150
                <assert>xs:boolean($result/*[1]) eq false()</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   151
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   152
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   153
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   154
    <xsl:template name="json-to-xml-009">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   155
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   156
            <description>Array Null</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   157
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   158
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   159
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   160
        <xsl:copy-of select=" json-to-xml($s1.null) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   161
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   162
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   163
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   164
                <assert-type>element(*)</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   165
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   166
                <assert>$result/*[1] instance of element(j:null,xs:untyped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   167
                <assert>empty($result/*[1]/(*|text()))</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   168
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   169
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   170
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   171
    <xsl:template name="json-to-xml-010">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   172
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   173
            <description>Larger 2</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   174
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   175
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   176
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   177
        <xsl:copy-of select=" json-to-xml(unparsed-text('data001.json')) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   178
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   179
            <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   180
                <assert-count>1</assert-count>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   181
                <assert-type>element(*)</assert-type>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   182
                <assert>count($result/*) eq 1</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   183
            </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   184
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   185
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   186
    <xsl:template name="json-to-xml-011">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   187
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   188
            <description>Larger 2</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   189
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   190
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   191
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   192
        <xsl:copy-of select=" json-to-xml(unparsed-text('data005.json')) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   193
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   194
    <xsl:template name="json-to-xml-012">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   195
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   196
            <description>Larger 2</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   197
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   198
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   199
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   200
        <xsl:copy-of select=" json-to-xml(unparsed-text('escapeText.json')) "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   201
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   202
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   203
    <!-- Escaping tests -->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   204
    <xsl:template name="json-to-xml-escape-001">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   205
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   206
            <description>Escaped quote string</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   207
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   208
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   209
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   210
        <xsl:copy-of select=" json-to-xml($escape.1)//j:string "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   211
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   212
            <test> json-to-xml($escape.1)//j:string</test>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   213
            <result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   214
                <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   215
                    <!--<assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
   216
                    <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}string)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   217
                    <assert-string-value>Data with " within it</assert-string-value>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   218
                    <any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   219
                        <assert>empty($result/@escaped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   220
                        <assert>$result/@escaped eq "false"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   221
                    </any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   222
                    <any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   223
                        <assert>empty($result/@escaped-key)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   224
                        <assert>$result/@escaped-key eq "false"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   225
                    </any-of>-->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   226
                </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   227
            </result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   228
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   229
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   230
    <xsl:template name="json-to-xml-escape-002">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   231
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   232
            <description>Escaped quote and key string</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   233
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   234
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   235
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   236
        <xsl:copy-of select=" json-to-xml($escape.2)//j:string "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   237
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   238
            <test> json-to-xml($escape.2)//j:string</test>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   239
            <result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   240
                <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   241
                    <!--<assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
   242
                    <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}string)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   243
                    <assert-string-value>Data with " within it</assert-string-value>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   244
                    <assert>$result/@key eq 'Key " with quote'</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   245
                    <any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   246
                        <assert>empty($result/@escaped)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   247
                        <assert>$result/@escaped eq "false"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   248
                    </any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   249
                    <any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   250
                        <assert>empty($result/@escaped-key)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   251
                        <assert>$result/@escaped-key eq "false"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   252
                    </any-of>-->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   253
                </all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   254
            </result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   255
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   256
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   257
    <xsl:template name="json-to-xml-escape-003">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   258
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   259
            <description>Escaped quote string - remaining escaped</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   260
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   261
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   262
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   263
        <xsl:copy-of select=" json-to-xml($escape.1,$options.escape)//j:string "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   264
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   265
            <test> json-to-xml($escape.1,$options.escape)//j:string</test>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   266
            <result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   267
                <!-- <all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   268
                    <assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
   269
                    <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}string)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   270
                    <assert-string-value>Data with \" within it</assert-string-value>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   271
                    <assert>$result/@escaped eq "true"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   272
                    <any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   273
                        <assert>empty($result/@escaped-key)</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   274
                        <assert>$result/@escaped-key eq "false"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   275
                    </any-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   276
                </all-of>-->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   277
            </result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   278
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   279
    </xsl:template>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   280
    <xsl:template name="json-to-xml-escape-004">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   281
        <xsl:variable name="metadata">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   282
            <description>Escaped quote string and key - remaining escaped</description>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   283
            <created by="John Lumley" on="2013-10-01"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   284
            <environment ref="JSON-XML"/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   285
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   286
        <xsl:copy-of select=" json-to-xml($escape.2,$options.escape)//j:string "/>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   287
        <xsl:variable name="expected-results">
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   288
            <test> json-to-xml($escape.2,$options.escape)//j:string</test>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   289
            <result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   290
                <!--<all-of>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   291
                    <assert-count>1</assert-count>
990
32ad9ac3c0e5 Namespace change for JSON (spec bug 28174)
Michael Kay <mike@saxonica.com>
parents: 938
diff changeset
   292
                    <assert-type>element(Q{http://www.w3.org/2005/xpath-functions}string)</assert-type>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   293
                    <assert-string-value>Data with \" within it</assert-string-value>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   294
                    <assert>$result/@key eq 'Key \" with quote'</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   295
                    <assert>$result/@escaped eq "true"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   296
                    <assert>$result/@escaped-key eq "true"</assert>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   297
                </all-of>-->
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   298
            </result>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   299
        </xsl:variable>
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   300
    </xsl:template>
1034
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   301
    <xsl:template name="json-to-xml-escape-005">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   302
        <xsl:variable name="metadata">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   303
            <description>Escaped character string - remaining escaped</description>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   304
            <created by="Debbie Lockett" on="2015-08-12"/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   305
            <environment ref="JSON-XML"/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   306
        </xsl:variable>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   307
        <xsl:copy-of select=" json-to-xml($escape.3,$options.escape)//j:string "/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   308
        <xsl:variable name="expected-results">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   309
            <test> json-to-xml($escape.3,$options.escape)//j:string</test>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   310
            <result>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   311
                <!-- <all-of>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   312
                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   313
                <assert>. = 'Data with \f within it'</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   314
                <assert>*/@escaped eq "true"</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   315
                <any-of>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   316
                    <assert>empty(*/@escaped-key)</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   317
                    <assert>*/@escaped-key eq "false"</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   318
                </any-of>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   319
            </all-of>-->
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   320
            </result>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   321
        </xsl:variable>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   322
    </xsl:template>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   323
    <xsl:template name="json-to-xml-escape-006">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   324
        <xsl:variable name="metadata">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   325
            <description>Escaped character string and key - remaining escaped</description>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   326
            <created by="Debbie Lockett" on="2015-08-12"/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   327
            <environment ref="JSON-XML"/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   328
        </xsl:variable>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   329
        <xsl:copy-of select=" json-to-xml($escape.4,$options.escape)//j:string "/>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   330
        <xsl:variable name="expected-results">
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   331
            <test> json-to-xml($escape.4,$options.escape)//j:string</test>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   332
            <result>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   333
                <!--<all-of>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   334
                <assert>* instance of element(Q{http://www.w3.org/2005/xpath-functions}string)</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   335
                <assert>. = 'Data with \f within it'</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   336
                <assert>*/@key eq 'Key \f with special character'</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   337
                <assert>*/@escaped eq "true"</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   338
                <assert>*/@escaped-key eq "true"</assert>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   339
            </all-of>-->
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   340
            </result>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   341
        </xsl:variable>
412d4f6bb7bf json-to-xml - reflect spec changes
Michael Kay <mike@saxonica.com>
parents: 990
diff changeset
   342
    </xsl:template>
938
48070b20cd79 Reverting json-to-xml tests (they were partially deleted)
abraaksm
parents:
diff changeset
   343
</xsl:stylesheet>