Merge lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
- bug-1189786-json-update
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Paul J. Lucas | ||||
Approved revision: | 11553 | ||||
Merged at revision: | 11550 | ||||
Proposed branch: | lp:~zorba-coders/zorba/bug-1189786-json-update | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
1898 lines (+333/-480) 79 files modified
modules/CMakeLists.txt (+1/-0) modules/com/zorba-xquery/www/modules/CMakeLists.txt (+0/-4) modules/com/zorba-xquery/www/modules/converters/json-options.xsd (+0/-60) modules/json/CMakeLists.txt (+16/-0) modules/json/json-xml.xq (+22/-57) src/context/static_context.cpp (+1/-1) src/functions/pregenerated/func_json.cpp (+10/-10) src/functions/pregenerated/func_json.h (+6/-6) src/functions/pregenerated/function_enum.h (+2/-2) src/runtime/json/json_impl.cpp (+9/-14) src/runtime/json/pregenerated/json.cpp (+54/-54) src/runtime/json/pregenerated/json.h (+14/-14) src/runtime/pregenerated/iterator_enum.h (+2/-2) src/runtime/spec/json/json.xml (+4/-4) src/runtime/spec/mappings.xml (+1/-1) src/runtime/visitors/pregenerated/planiter_visitor.h (+6/-6) src/runtime/visitors/pregenerated/printer_visitor.cpp (+26/-26) src/runtime/visitors/pregenerated/printer_visitor.h (+4/-4) test/rbkt/Queries/CMakeLists.txt (+1/-0) test/rbkt/Queries/zorba/error/data-location-json-2.xq (+2/-2) test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq (+4/-8) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq (+4/-7) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq (+4/-7) test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq (+3/-7) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq (+3/-6) test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq (+3/-7) test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq (+3/-3) test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq (+5/-5) test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq (+3/-3) test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq (+3/-3) test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq (+5/-5) test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq (+5/-5) test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq (+3/-7) test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq (+2/-2) test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq (+3/-7) test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq (+2/-2) test/update/Queries/zorba/store/sc3_ex3.xq (+3/-5) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug-1189786-json-update | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul J. Lucas | Approve | ||
Chris Hillery | Approve | ||
Review via email: mp+174085@code.launchpad.net |
Commit message
Update "JSON" module: now known as "json-xml", function names changed, namespace changed to zorba.io, moved out of unnecessary subdirectories.
Description of the change
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "ZorbaVQ" failed.
Check console output at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "ZorbaVQ" failed.
Check console output at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "ZorbaVQ" failed.
Check console output at http://
- 11552. By Chris Hillery
-
Merge from trunk.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "TestZorbaUbuntu" failed.
3 tests failed (8345 total tests run).
Check test results at http://
- 11553. By Chris Hillery
-
Fixing a few last tests.
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Voting criteria failed for the following merge proposals:
https:/
Votes: {'Approve': 1, 'Pending': 1, 'Needs commit message': 1}
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue result for https:/
Stage "CommitZorba" failed.
Check console output at http://
Paul J. Lucas (paul-lucas) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for the following merge proposals:
https:/
Progress dashboard at http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue succeeded - proposal merged!
Preview Diff
1 | === modified file 'modules/CMakeLists.txt' | |||
2 | --- modules/CMakeLists.txt 2013-07-04 22:17:19 +0000 | |||
3 | +++ modules/CMakeLists.txt 2013-07-11 06:16:30 +0000 | |||
4 | @@ -18,6 +18,7 @@ | |||
5 | 18 | ADD_SUBDIRECTORY(xqxq) | 18 | ADD_SUBDIRECTORY(xqxq) |
6 | 19 | ADD_SUBDIRECTORY(w3c) | 19 | ADD_SUBDIRECTORY(w3c) |
7 | 20 | ADD_SUBDIRECTORY(full-text) | 20 | ADD_SUBDIRECTORY(full-text) |
8 | 21 | ADD_SUBDIRECTORY(json) | ||
9 | 21 | ADD_SUBDIRECTORY(nodes) | 22 | ADD_SUBDIRECTORY(nodes) |
10 | 22 | 23 | ||
11 | 23 | # Add external module projects - any subdirectories of a directory | 24 | # Add external module projects - any subdirectories of a directory |
12 | 24 | 25 | ||
13 | === modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt' | |||
14 | --- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-04 22:17:19 +0000 | |||
15 | +++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-11 06:16:30 +0000 | |||
16 | @@ -88,10 +88,6 @@ | |||
17 | 88 | # Subdirectories | 88 | # Subdirectories |
18 | 89 | DECLARE_ZORBA_MODULE(FILE converters/base64.xq VERSION 2.0 | 89 | DECLARE_ZORBA_MODULE(FILE converters/base64.xq VERSION 2.0 |
19 | 90 | URI "http://www.zorba-xquery.com/modules/converters/base64") | 90 | URI "http://www.zorba-xquery.com/modules/converters/base64") |
20 | 91 | DECLARE_ZORBA_MODULE(FILE converters/json.xq VERSION 2.0 | ||
21 | 92 | URI "http://www.zorba-xquery.com/modules/converters/json") | ||
22 | 93 | DECLARE_ZORBA_SCHEMA(FILE converters/json-options.xsd | ||
23 | 94 | URI "http://www.zorba-xquery.com/modules/converters/json-options") | ||
24 | 95 | DECLARE_ZORBA_MODULE(FILE introspection/sctx.xq VERSION 2.0 | 91 | DECLARE_ZORBA_MODULE(FILE introspection/sctx.xq VERSION 2.0 |
25 | 96 | URI "http://www.zorba-xquery.com/modules/introspection/sctx") | 92 | URI "http://www.zorba-xquery.com/modules/introspection/sctx") |
26 | 97 | 93 | ||
27 | 98 | 94 | ||
28 | === removed file 'modules/com/zorba-xquery/www/modules/converters/json-options.xsd' | |||
29 | --- modules/com/zorba-xquery/www/modules/converters/json-options.xsd 2013-02-07 17:24:36 +0000 | |||
30 | +++ modules/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000 | |||
31 | @@ -1,60 +0,0 @@ | |||
32 | 1 | <!-- | ||
33 | 2 | ! Copyright 2006-2008 The FLWOR Foundation. | ||
34 | 3 | ! | ||
35 | 4 | ! Licensed under the Apache License, Version 2.0 (the "License"); | ||
36 | 5 | ! you may not use this file except in compliance with the License. | ||
37 | 6 | ! You may obtain a copy of the License at | ||
38 | 7 | ! | ||
39 | 8 | ! http://www.apache.org/licenses/LICENSE-2.0 | ||
40 | 9 | ! | ||
41 | 10 | ! Unless required by applicable law or agreed to in writing, software | ||
42 | 11 | ! distributed under the License is distributed on an "AS IS" BASIS, | ||
43 | 12 | ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
44 | 13 | ! See the License for the specific language governing permissions and | ||
45 | 14 | ! limitations under the License. | ||
46 | 15 | --> | ||
47 | 16 | |||
48 | 17 | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
49 | 18 | xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options" | ||
50 | 19 | targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options" | ||
51 | 20 | elementFormDefault="qualified" | ||
52 | 21 | attributeFormDefault="unqualified"> | ||
53 | 22 | |||
54 | 23 | <xs:element name="options"> | ||
55 | 24 | <xs:complexType> | ||
56 | 25 | <xs:all> | ||
57 | 26 | |||
58 | 27 | <xs:element name="json-format" minOccurs="1" maxOccurs="1"> | ||
59 | 28 | <xs:complexType> | ||
60 | 29 | <xs:attribute name="value" use="required"> | ||
61 | 30 | <xs:simpleType> | ||
62 | 31 | <xs:restriction base="xs:string"> | ||
63 | 32 | <xs:enumeration value="Snelson"/> | ||
64 | 33 | <xs:enumeration value="JsonML-array"/> | ||
65 | 34 | <!-- <xs:enumeration value="JsonML-object"/> --> | ||
66 | 35 | </xs:restriction> | ||
67 | 36 | </xs:simpleType> | ||
68 | 37 | </xs:attribute> | ||
69 | 38 | </xs:complexType> | ||
70 | 39 | </xs:element> | ||
71 | 40 | |||
72 | 41 | <xs:element name="whitespace" minOccurs="0" maxOccurs="1"> | ||
73 | 42 | <xs:complexType> | ||
74 | 43 | <xs:attribute name="value" use="required"> | ||
75 | 44 | <xs:simpleType> | ||
76 | 45 | <xs:restriction base="xs:string"> | ||
77 | 46 | <xs:enumeration value="none"/> | ||
78 | 47 | <xs:enumeration value="some"/> | ||
79 | 48 | <xs:enumeration value="indent"/> | ||
80 | 49 | </xs:restriction> | ||
81 | 50 | </xs:simpleType> | ||
82 | 51 | </xs:attribute> | ||
83 | 52 | </xs:complexType> | ||
84 | 53 | </xs:element> | ||
85 | 54 | |||
86 | 55 | </xs:all> | ||
87 | 56 | </xs:complexType> | ||
88 | 57 | </xs:element> | ||
89 | 58 | </xs:schema> | ||
90 | 59 | |||
91 | 60 | <!-- vim:set et sw=2 ts=2: --> | ||
92 | 61 | 0 | ||
93 | === added directory 'modules/json' | |||
94 | === added file 'modules/json/CMakeLists.txt' | |||
95 | --- modules/json/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
96 | +++ modules/json/CMakeLists.txt 2013-07-11 06:16:30 +0000 | |||
97 | @@ -0,0 +1,16 @@ | |||
98 | 1 | # Copyright 2013 The FLWOR Foundation. | ||
99 | 2 | # | ||
100 | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
101 | 4 | # you may not use this file except in compliance with the License. | ||
102 | 5 | # You may obtain a copy of the License at | ||
103 | 6 | # | ||
104 | 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
105 | 8 | # | ||
106 | 9 | # Unless required by applicable law or agreed to in writing, software | ||
107 | 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
108 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
109 | 12 | # See the License for the specific language governing permissions and | ||
110 | 13 | # limitations under the License. | ||
111 | 14 | |||
112 | 15 | DECLARE_ZORBA_MODULE(FILE json-xml.xq VERSION 1.0 | ||
113 | 16 | URI "http://zorba.io/modules/json-xml") | ||
114 | 0 | 17 | ||
115 | === renamed file 'modules/com/zorba-xquery/www/modules/converters/json.xq' => 'modules/json/json-xml.xq' | |||
116 | --- modules/com/zorba-xquery/www/modules/converters/json.xq 2013-06-25 03:55:20 +0000 | |||
117 | +++ modules/json/json-xml.xq 2013-07-11 06:16:30 +0000 | |||
118 | @@ -18,7 +18,7 @@ | |||
119 | 18 | 18 | ||
120 | 19 | (:~ | 19 | (:~ |
121 | 20 | : Using this module, you can parse JSON data into XML, manipulate it like any | 20 | : Using this module, you can parse JSON data into XML, manipulate it like any |
123 | 21 | : other XML data using XQuery, and serialize the result back as JSON. | 21 | : other XML data using XQuery, and serialize the result back as JSON.<p/> |
124 | 22 | : | 22 | : |
125 | 23 | : There are many ways to represent JSON data in XML, some loss-less ("round | 23 | : There are many ways to represent JSON data in XML, some loss-less ("round |
126 | 24 | : tripable") and some lossy ("one way"). Loss-less representations preserve | 24 | : tripable") and some lossy ("one way"). Loss-less representations preserve |
127 | @@ -93,34 +93,25 @@ | |||
128 | 93 | : @author Paul J. Lucas | 93 | : @author Paul J. Lucas |
129 | 94 | : @project Zorba/Data Converters/JSON | 94 | : @project Zorba/Data Converters/JSON |
130 | 95 | :) | 95 | :) |
137 | 96 | module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 96 | module namespace jx = "http://zorba.io/modules/json-xml"; |
132 | 97 | |||
133 | 98 | import module namespace schema = "http://www.zorba-xquery.com/modules/schema"; | ||
134 | 99 | |||
135 | 100 | import schema namespace json-options = | ||
136 | 101 | "http://www.zorba-xquery.com/modules/converters/json-options"; | ||
138 | 102 | 97 | ||
139 | 103 | declare namespace an = "http://www.zorba-xquery.com/annotations"; | 98 | declare namespace an = "http://www.zorba-xquery.com/annotations"; |
140 | 104 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; | 99 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
141 | 105 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; | 100 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
142 | 106 | 101 | ||
143 | 107 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; | 102 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
145 | 108 | declare option ver:module-version "2.0"; | 103 | declare option ver:module-version "1.0"; |
146 | 109 | 104 | ||
147 | 110 | (:~ | 105 | (:~ |
148 | 111 | : Parses JSON data from a string and returns an XDM instance using one of the | 106 | : Parses JSON data from a string and returns an XDM instance using one of the |
150 | 112 | : representations described above. | 107 | : representations described above.<p/> |
151 | 113 | : | 108 | : |
152 | 114 | : @param $json The JSON data to parse. | 109 | : @param $json The JSON data to parse. |
153 | 115 | : @param $options The parsing options, for example: | 110 | : @param $options The parsing options, for example: |
154 | 116 | : <pre> | 111 | : <pre> |
158 | 117 | : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 112 | : { "json-format" : "JsonML-array" } |
156 | 118 | : <json-format value="JsonML-array"/> | ||
157 | 119 | : </options> | ||
159 | 120 | : </pre> | 113 | : </pre> |
160 | 121 | : @return said XDM instance. | 114 | : @return said XDM instance. |
161 | 122 | : @error err:XQDY0027 if $options can not be validated against the | ||
162 | 123 | : json-options schema. | ||
163 | 124 | : @error zerr:ZJPE0001 if $json contains an illegal JSON character. | 115 | : @error zerr:ZJPE0001 if $json contains an illegal JSON character. |
164 | 125 | : @error zerr:ZJPE0002 if $json contains an illegal Unicode code-point. | 116 | : @error zerr:ZJPE0002 if $json contains an illegal Unicode code-point. |
165 | 126 | : @error zerr:ZJPE0003 if $json contains an illegal JSON character escape. | 117 | : @error zerr:ZJPE0003 if $json contains an illegal JSON character escape. |
166 | @@ -131,21 +122,17 @@ | |||
167 | 131 | : @error zerr:ZJPE0008 if $json contains an illegal QName. | 122 | : @error zerr:ZJPE0008 if $json contains an illegal QName. |
168 | 132 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq | 123 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq |
169 | 133 | :) | 124 | :) |
171 | 134 | declare function json:parse( | 125 | declare function jx:json-to-xml( |
172 | 135 | $json as xs:string?, | 126 | $json as xs:string?, |
174 | 136 | $options as element(json-options:options) | 127 | $options as object() |
175 | 137 | ) as element(*,xs:untyped)* | 128 | ) as element(*,xs:untyped)* |
176 | 138 | { | 129 | { |
182 | 139 | let $validated-options := if ( schema:is-validated( $options ) ) then | 130 | jx:json-to-xml-internal( $json, $options ) |
178 | 140 | $options | ||
179 | 141 | else | ||
180 | 142 | validate { $options } | ||
181 | 143 | return json:parse-internal( $json, $validated-options ) | ||
183 | 144 | }; | 131 | }; |
184 | 145 | 132 | ||
185 | 146 | (:~ | 133 | (:~ |
186 | 147 | : Parses JSON data from a string and returns an XDM instance using the Snelson | 134 | : Parses JSON data from a string and returns an XDM instance using the Snelson |
188 | 148 | : representation described above. | 135 | : representation described above.<p/> |
189 | 149 | : | 136 | : |
190 | 150 | : @param $json The JSON data to parse. | 137 | : @param $json The JSON data to parse. |
191 | 151 | : @return said XDM instance. | 138 | : @return said XDM instance. |
192 | @@ -159,36 +146,25 @@ | |||
193 | 159 | : @error zerr:ZJPE0008 if $json contains an illegal QName. | 146 | : @error zerr:ZJPE0008 if $json contains an illegal QName. |
194 | 160 | : @example test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq | 147 | : @example test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq |
195 | 161 | :) | 148 | :) |
197 | 162 | declare function json:parse( | 149 | declare function jx:json-to-xml( |
198 | 163 | $json as xs:string? | 150 | $json as xs:string? |
199 | 164 | ) as element(*,xs:untyped)* | 151 | ) as element(*,xs:untyped)* |
200 | 165 | { | 152 | { |
209 | 166 | json:parse-internal( | 153 | jx:json-to-xml-internal( |
210 | 167 | $json, | 154 | $json, { "json-format" : "Snelson" } |
203 | 168 | validate { | ||
204 | 169 | <options | ||
205 | 170 | xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | ||
206 | 171 | <json-format value="Snelson"/> | ||
207 | 172 | </options> | ||
208 | 173 | } | ||
211 | 174 | ) | 155 | ) |
212 | 175 | }; | 156 | }; |
213 | 176 | 157 | ||
214 | 177 | (:~ | 158 | (:~ |
215 | 178 | : Serializes an XDM into JSON using one of the representations described | 159 | : Serializes an XDM into JSON using one of the representations described |
217 | 179 | : above. | 160 | : above.<p/> |
218 | 180 | : | 161 | : |
219 | 181 | : @param $xml The XDM to serialize. | 162 | : @param $xml The XDM to serialize. |
220 | 182 | : @param $options The serializing options, for example: | 163 | : @param $options The serializing options, for example: |
221 | 183 | : <pre> | 164 | : <pre> |
226 | 184 | : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 165 | : { "json-format" : "JsonML-array", "whitespace" : "indent" } |
223 | 185 | : <json-format value="JsonML-array"/> | ||
224 | 186 | : <whitespace value="indent"/> | ||
225 | 187 | : </options> | ||
227 | 188 | : </pre> | 166 | : </pre> |
228 | 189 | : @return a JSON string. | 167 | : @return a JSON string. |
229 | 190 | : @error err:XQDY0027 if $options can not be validated against the | ||
230 | 191 | : json-options schema. | ||
231 | 192 | : @error zerr:ZJSE0001 if $xml is not a document or element node. | 168 | : @error zerr:ZJSE0001 if $xml is not a document or element node. |
232 | 193 | : @error zerr:ZJSE0002 if $xml contains an element that is missing a required | 169 | : @error zerr:ZJSE0002 if $xml contains an element that is missing a required |
233 | 194 | : attribute. | 170 | : attribute. |
234 | @@ -201,21 +177,17 @@ | |||
235 | 201 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. | 177 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. |
236 | 202 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq | 178 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq |
237 | 203 | :) | 179 | :) |
239 | 204 | declare function json:serialize( | 180 | declare function jx:xml-to-json( |
240 | 205 | $xml as item()*, | 181 | $xml as item()*, |
242 | 206 | $options as element(json-options:options) | 182 | $options as object() |
243 | 207 | ) as xs:string | 183 | ) as xs:string |
244 | 208 | { | 184 | { |
250 | 209 | let $validated-options := if ( schema:is-validated( $options ) ) then | 185 | jx:xml-to-json-internal( $xml, $options ) |
246 | 210 | $options | ||
247 | 211 | else | ||
248 | 212 | validate { $options } | ||
249 | 213 | return json:serialize-internal( $xml, $validated-options ) | ||
251 | 214 | }; | 186 | }; |
252 | 215 | 187 | ||
253 | 216 | (:~ | 188 | (:~ |
254 | 217 | : Serializes an XDM into JSON using one of the representations described | 189 | : Serializes an XDM into JSON using one of the representations described |
256 | 218 | : above. | 190 | : above.<p/> |
257 | 219 | : | 191 | : |
258 | 220 | : @param $xml The XDM to serialize. | 192 | : @param $xml The XDM to serialize. |
259 | 221 | : @return a JSON string. | 193 | : @return a JSON string. |
260 | @@ -231,28 +203,21 @@ | |||
261 | 231 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. | 203 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. |
262 | 232 | : @example test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq | 204 | : @example test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq |
263 | 233 | :) | 205 | :) |
265 | 234 | declare function json:serialize( | 206 | declare function jx:xml-to-json( |
266 | 235 | $xml as item()* | 207 | $xml as item()* |
267 | 236 | ) as xs:string | 208 | ) as xs:string |
268 | 237 | { | 209 | { |
277 | 238 | json:serialize-internal($xml, | 210 | jx:xml-to-json-internal($xml, { "json-format" : "Snelson" }) |
270 | 239 | validate { | ||
271 | 240 | <options | ||
272 | 241 | xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | ||
273 | 242 | <json-format value="Snelson"/> | ||
274 | 243 | </options> | ||
275 | 244 | } | ||
276 | 245 | ) | ||
278 | 246 | }; | 211 | }; |
279 | 247 | 212 | ||
280 | 248 | (:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::) | 213 | (:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::) |
281 | 249 | 214 | ||
283 | 250 | declare %private function json:parse-internal( | 215 | declare %private function jx:json-to-xml-internal( |
284 | 251 | $json as xs:string?, | 216 | $json as xs:string?, |
285 | 252 | $options as item()? | 217 | $options as item()? |
286 | 253 | ) as element()* external; | 218 | ) as element()* external; |
287 | 254 | 219 | ||
289 | 255 | declare %an:streamable %private function json:serialize-internal( | 220 | declare %an:streamable %private function jx:xml-to-json-internal( |
290 | 256 | $xml as item()*, | 221 | $xml as item()*, |
291 | 257 | $options as item()? | 222 | $options as item()? |
292 | 258 | ) as xs:string external; | 223 | ) as xs:string external; |
293 | 259 | 224 | ||
294 | === modified file 'src/context/static_context.cpp' | |||
295 | --- src/context/static_context.cpp 2013-07-04 22:17:19 +0000 | |||
296 | +++ src/context/static_context.cpp 2013-07-11 06:16:30 +0000 | |||
297 | @@ -355,7 +355,7 @@ | |||
298 | 355 | 355 | ||
299 | 356 | const char* | 356 | const char* |
300 | 357 | static_context::ZORBA_JSON_FN_NS = | 357 | static_context::ZORBA_JSON_FN_NS = |
302 | 358 | "http://www.zorba-xquery.com/modules/converters/json"; | 358 | "http://zorba.io/modules/json-xml"; |
303 | 359 | 359 | ||
304 | 360 | const char* | 360 | const char* |
305 | 361 | static_context::ZORBA_NODEREF_FN_NS = | 361 | static_context::ZORBA_NODEREF_FN_NS = |
306 | 362 | 362 | ||
307 | === modified file 'src/functions/pregenerated/func_json.cpp' | |||
308 | --- src/functions/pregenerated/func_json.cpp 2013-03-05 23:11:50 +0000 | |||
309 | +++ src/functions/pregenerated/func_json.cpp 2013-07-11 06:16:30 +0000 | |||
310 | @@ -31,24 +31,24 @@ | |||
311 | 31 | 31 | ||
312 | 32 | 32 | ||
313 | 33 | 33 | ||
315 | 34 | PlanIter_t fn_zorba_json_parse_internal::codegen( | 34 | PlanIter_t fn_zorba_json_json_to_xml_internal::codegen( |
316 | 35 | CompilerCB*, | 35 | CompilerCB*, |
317 | 36 | static_context* sctx, | 36 | static_context* sctx, |
318 | 37 | const QueryLoc& loc, | 37 | const QueryLoc& loc, |
319 | 38 | std::vector<PlanIter_t>& argv, | 38 | std::vector<PlanIter_t>& argv, |
320 | 39 | expr& ann) const | 39 | expr& ann) const |
321 | 40 | { | 40 | { |
323 | 41 | return new JSONParseInternal(sctx, loc, argv); | 41 | return new JSONtoXMLInternal(sctx, loc, argv); |
324 | 42 | } | 42 | } |
325 | 43 | 43 | ||
327 | 44 | PlanIter_t fn_zorba_json_serialize_internal::codegen( | 44 | PlanIter_t fn_zorba_json_xml_to_json_internal::codegen( |
328 | 45 | CompilerCB*, | 45 | CompilerCB*, |
329 | 46 | static_context* sctx, | 46 | static_context* sctx, |
330 | 47 | const QueryLoc& loc, | 47 | const QueryLoc& loc, |
331 | 48 | std::vector<PlanIter_t>& argv, | 48 | std::vector<PlanIter_t>& argv, |
332 | 49 | expr& ann) const | 49 | expr& ann) const |
333 | 50 | { | 50 | { |
335 | 51 | return new JSONSerializeInternal(sctx, loc, argv); | 51 | return new XMLtoJSONInternal(sctx, loc, argv); |
336 | 52 | } | 52 | } |
337 | 53 | 53 | ||
338 | 54 | void populate_context_json(static_context* sctx) | 54 | void populate_context_json(static_context* sctx) |
339 | @@ -56,12 +56,12 @@ | |||
340 | 56 | 56 | ||
341 | 57 | 57 | ||
342 | 58 | { | 58 | { |
345 | 59 | DECL_WITH_KIND(sctx, fn_zorba_json_parse_internal, | 59 | DECL_WITH_KIND(sctx, fn_zorba_json_json_to_xml_internal, |
346 | 60 | (createQName("http://www.zorba-xquery.com/modules/converters/json","","parse-internal"), | 60 | (createQName("http://zorba.io/modules/json-xml","","json-to-xml-internal"), |
347 | 61 | GENV_TYPESYSTEM.STRING_TYPE_ONE, | 61 | GENV_TYPESYSTEM.STRING_TYPE_ONE, |
348 | 62 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, | 62 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, |
349 | 63 | GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), | 63 | GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
351 | 64 | FunctionConsts::FN_ZORBA_JSON_PARSE_INTERNAL_2); | 64 | FunctionConsts::FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2); |
352 | 65 | 65 | ||
353 | 66 | } | 66 | } |
354 | 67 | 67 | ||
355 | @@ -69,12 +69,12 @@ | |||
356 | 69 | 69 | ||
357 | 70 | 70 | ||
358 | 71 | { | 71 | { |
361 | 72 | DECL_WITH_KIND(sctx, fn_zorba_json_serialize_internal, | 72 | DECL_WITH_KIND(sctx, fn_zorba_json_xml_to_json_internal, |
362 | 73 | (createQName("http://www.zorba-xquery.com/modules/converters/json","","serialize-internal"), | 73 | (createQName("http://zorba.io/modules/json-xml","","xml-to-json-internal"), |
363 | 74 | GENV_TYPESYSTEM.ITEM_TYPE_STAR, | 74 | GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
364 | 75 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, | 75 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, |
365 | 76 | GENV_TYPESYSTEM.STRING_TYPE_ONE), | 76 | GENV_TYPESYSTEM.STRING_TYPE_ONE), |
367 | 77 | FunctionConsts::FN_ZORBA_JSON_SERIALIZE_INTERNAL_2); | 77 | FunctionConsts::FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2); |
368 | 78 | 78 | ||
369 | 79 | } | 79 | } |
370 | 80 | 80 | ||
371 | 81 | 81 | ||
372 | === modified file 'src/functions/pregenerated/func_json.h' | |||
373 | --- src/functions/pregenerated/func_json.h 2013-03-05 23:11:50 +0000 | |||
374 | +++ src/functions/pregenerated/func_json.h 2013-07-11 06:16:30 +0000 | |||
375 | @@ -38,11 +38,11 @@ | |||
376 | 38 | 38 | ||
377 | 39 | 39 | ||
378 | 40 | 40 | ||
381 | 41 | //fn-zorba-json:parse-internal | 41 | //fn-zorba-json:json-to-xml-internal |
382 | 42 | class fn_zorba_json_parse_internal : public function | 42 | class fn_zorba_json_json_to_xml_internal : public function |
383 | 43 | { | 43 | { |
384 | 44 | public: | 44 | public: |
386 | 45 | fn_zorba_json_parse_internal(const signature& sig, FunctionConsts::FunctionKind kind) | 45 | fn_zorba_json_json_to_xml_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
387 | 46 | : | 46 | : |
388 | 47 | function(sig, kind) | 47 | function(sig, kind) |
389 | 48 | { | 48 | { |
390 | @@ -53,11 +53,11 @@ | |||
391 | 53 | }; | 53 | }; |
392 | 54 | 54 | ||
393 | 55 | 55 | ||
396 | 56 | //fn-zorba-json:serialize-internal | 56 | //fn-zorba-json:xml-to-json-internal |
397 | 57 | class fn_zorba_json_serialize_internal : public function | 57 | class fn_zorba_json_xml_to_json_internal : public function |
398 | 58 | { | 58 | { |
399 | 59 | public: | 59 | public: |
401 | 60 | fn_zorba_json_serialize_internal(const signature& sig, FunctionConsts::FunctionKind kind) | 60 | fn_zorba_json_xml_to_json_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
402 | 61 | : | 61 | : |
403 | 62 | function(sig, kind) | 62 | function(sig, kind) |
404 | 63 | { | 63 | { |
405 | 64 | 64 | ||
406 | === modified file 'src/functions/pregenerated/function_enum.h' | |||
407 | --- src/functions/pregenerated/function_enum.h 2013-06-26 00:10:23 +0000 | |||
408 | +++ src/functions/pregenerated/function_enum.h 2013-07-11 06:16:30 +0000 | |||
409 | @@ -250,8 +250,8 @@ | |||
410 | 250 | FN_ZORBA_INTROSPECT_SCTX_OPTION_1, | 250 | FN_ZORBA_INTROSPECT_SCTX_OPTION_1, |
411 | 251 | FN_ZORBA_INTROSPECT_SCTX_FUNCTION_ANNOTATIONS_2, | 251 | FN_ZORBA_INTROSPECT_SCTX_FUNCTION_ANNOTATIONS_2, |
412 | 252 | FN_ZORBA_ITEM_SIZE_1, | 252 | FN_ZORBA_ITEM_SIZE_1, |
415 | 253 | FN_ZORBA_JSON_PARSE_INTERNAL_2, | 253 | FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2, |
416 | 254 | FN_ZORBA_JSON_SERIALIZE_INTERNAL_2, | 254 | FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2, |
417 | 255 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_1, | 255 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_1, |
418 | 256 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_2, | 256 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_2, |
419 | 257 | FN_JSONIQ_ENCODE_FOR_ROUNDTRIP_1, | 257 | FN_JSONIQ_ENCODE_FOR_ROUNDTRIP_1, |
420 | 258 | 258 | ||
421 | === modified file 'src/runtime/json/json_impl.cpp' | |||
422 | --- src/runtime/json/json_impl.cpp 2013-06-01 00:30:39 +0000 | |||
423 | +++ src/runtime/json/json_impl.cpp 2013-07-11 06:16:30 +0000 | |||
424 | @@ -39,27 +39,22 @@ | |||
425 | 39 | 39 | ||
426 | 40 | typedef map<zstring,zstring> options_type; | 40 | typedef map<zstring,zstring> options_type; |
427 | 41 | 41 | ||
429 | 42 | static void get_options( store::Item_t const &options_element, | 42 | static void get_options( store::Item_t const &options_object, |
430 | 43 | options_type *options ) { | 43 | options_type *options ) { |
434 | 44 | ZORBA_ASSERT( options_element->getNodeKind() == | 44 | ZORBA_ASSERT( options_object->getKind() == store::Item::OBJECT ); |
435 | 45 | store::StoreConsts::elementNode ); | 45 | store::Iterator_t i = options_object->getObjectKeys(); |
433 | 46 | store::Iterator_t i = options_element->getChildren(); | ||
436 | 47 | i->open(); | 46 | i->open(); |
445 | 48 | store::Item_t option_item; | 47 | store::Item_t option_key; |
446 | 49 | while ( i->next( option_item ) ) { | 48 | while ( i->next( option_key ) ) { |
447 | 50 | if ( option_item->getNodeKind() == store::StoreConsts::elementNode ) { | 49 | zstring const name( option_key->getStringValue() ); |
448 | 51 | zstring const name( option_item->getNodeName()->getStringValue() ); | 50 | (*options)[ name ] = options_object->getObjectValue(option_key)->getStringValue(); |
441 | 52 | zstring value; | ||
442 | 53 | get_attribute_value( option_item, "value", &value ); | ||
443 | 54 | (*options)[ name ] = value; | ||
444 | 55 | } | ||
449 | 56 | } | 51 | } |
450 | 57 | i->close(); | 52 | i->close(); |
451 | 58 | } | 53 | } |
452 | 59 | 54 | ||
453 | 60 | /////////////////////////////////////////////////////////////////////////////// | 55 | /////////////////////////////////////////////////////////////////////////////// |
454 | 61 | 56 | ||
456 | 62 | bool JSONParseInternal::nextImpl( store::Item_t& result, | 57 | bool JSONtoXMLInternal::nextImpl( store::Item_t& result, |
457 | 63 | PlanState &planState ) const { | 58 | PlanState &planState ) const { |
458 | 64 | store::Item_t cur_item; | 59 | store::Item_t cur_item; |
459 | 65 | options_type options; | 60 | options_type options; |
460 | @@ -190,7 +185,7 @@ | |||
461 | 190 | 185 | ||
462 | 191 | /////////////////////////////////////////////////////////////////////////////// | 186 | /////////////////////////////////////////////////////////////////////////////// |
463 | 192 | 187 | ||
465 | 193 | bool JSONSerializeInternal::nextImpl( store::Item_t& result, | 188 | bool XMLtoJSONInternal::nextImpl( store::Item_t& result, |
466 | 194 | PlanState &planState ) const { | 189 | PlanState &planState ) const { |
467 | 195 | store::Item_t cur_item; | 190 | store::Item_t cur_item; |
468 | 196 | options_type options; | 191 | options_type options; |
469 | 197 | 192 | ||
470 | === modified file 'src/runtime/json/pregenerated/json.cpp' | |||
471 | --- src/runtime/json/pregenerated/json.cpp 2013-03-05 23:11:50 +0000 | |||
472 | +++ src/runtime/json/pregenerated/json.cpp 2013-07-11 06:16:30 +0000 | |||
473 | @@ -32,60 +32,60 @@ | |||
474 | 32 | 32 | ||
475 | 33 | namespace zorba { | 33 | namespace zorba { |
476 | 34 | 34 | ||
531 | 35 | // <JSONParseInternal> | 35 | // <JSONtoXMLInternal> |
532 | 36 | SERIALIZABLE_CLASS_VERSIONS(JSONParseInternal) | 36 | SERIALIZABLE_CLASS_VERSIONS(JSONtoXMLInternal) |
533 | 37 | 37 | ||
534 | 38 | void JSONParseInternal::serialize(::zorba::serialization::Archiver& ar) | 38 | void JSONtoXMLInternal::serialize(::zorba::serialization::Archiver& ar) |
535 | 39 | { | 39 | { |
536 | 40 | serialize_baseclass(ar, | 40 | serialize_baseclass(ar, |
537 | 41 | (NaryBaseIterator<JSONParseInternal, PlanIteratorState>*)this); | 41 | (NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>*)this); |
538 | 42 | } | 42 | } |
539 | 43 | 43 | ||
540 | 44 | 44 | ||
541 | 45 | void JSONParseInternal::accept(PlanIterVisitor& v) const | 45 | void JSONtoXMLInternal::accept(PlanIterVisitor& v) const |
542 | 46 | { | 46 | { |
543 | 47 | v.beginVisit(*this); | 47 | v.beginVisit(*this); |
544 | 48 | 48 | ||
545 | 49 | std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); | 49 | std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
546 | 50 | std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); | 50 | std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
547 | 51 | for ( ; lIter != lEnd; ++lIter ){ | 51 | for ( ; lIter != lEnd; ++lIter ){ |
548 | 52 | (*lIter)->accept(v); | 52 | (*lIter)->accept(v); |
549 | 53 | } | 53 | } |
550 | 54 | 54 | ||
551 | 55 | v.endVisit(*this); | 55 | v.endVisit(*this); |
552 | 56 | } | 56 | } |
553 | 57 | 57 | ||
554 | 58 | JSONParseInternal::~JSONParseInternal() {} | 58 | JSONtoXMLInternal::~JSONtoXMLInternal() {} |
555 | 59 | 59 | ||
556 | 60 | // </JSONParseInternal> | 60 | // </JSONtoXMLInternal> |
557 | 61 | 61 | ||
558 | 62 | 62 | ||
559 | 63 | // <JSONSerializeInternal> | 63 | // <XMLtoJSONInternal> |
560 | 64 | SERIALIZABLE_CLASS_VERSIONS(JSONSerializeInternal) | 64 | SERIALIZABLE_CLASS_VERSIONS(XMLtoJSONInternal) |
561 | 65 | 65 | ||
562 | 66 | void JSONSerializeInternal::serialize(::zorba::serialization::Archiver& ar) | 66 | void XMLtoJSONInternal::serialize(::zorba::serialization::Archiver& ar) |
563 | 67 | { | 67 | { |
564 | 68 | serialize_baseclass(ar, | 68 | serialize_baseclass(ar, |
565 | 69 | (NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>*)this); | 69 | (NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>*)this); |
566 | 70 | } | 70 | } |
567 | 71 | 71 | ||
568 | 72 | 72 | ||
569 | 73 | void JSONSerializeInternal::accept(PlanIterVisitor& v) const | 73 | void XMLtoJSONInternal::accept(PlanIterVisitor& v) const |
570 | 74 | { | 74 | { |
571 | 75 | v.beginVisit(*this); | 75 | v.beginVisit(*this); |
572 | 76 | 76 | ||
573 | 77 | std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); | 77 | std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
574 | 78 | std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); | 78 | std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
575 | 79 | for ( ; lIter != lEnd; ++lIter ){ | 79 | for ( ; lIter != lEnd; ++lIter ){ |
576 | 80 | (*lIter)->accept(v); | 80 | (*lIter)->accept(v); |
577 | 81 | } | 81 | } |
578 | 82 | 82 | ||
579 | 83 | v.endVisit(*this); | 83 | v.endVisit(*this); |
580 | 84 | } | 84 | } |
581 | 85 | 85 | ||
582 | 86 | JSONSerializeInternal::~JSONSerializeInternal() {} | 86 | XMLtoJSONInternal::~XMLtoJSONInternal() {} |
583 | 87 | 87 | ||
584 | 88 | // </JSONSerializeInternal> | 88 | // </XMLtoJSONInternal> |
585 | 89 | 89 | ||
586 | 90 | 90 | ||
587 | 91 | 91 | ||
588 | 92 | 92 | ||
589 | === modified file 'src/runtime/json/pregenerated/json.h' | |||
590 | --- src/runtime/json/pregenerated/json.h 2013-03-05 23:11:50 +0000 | |||
591 | +++ src/runtime/json/pregenerated/json.h 2013-07-11 06:16:30 +0000 | |||
592 | @@ -39,25 +39,25 @@ | |||
593 | 39 | * | 39 | * |
594 | 40 | * Author: Zorba Team | 40 | * Author: Zorba Team |
595 | 41 | */ | 41 | */ |
597 | 42 | class JSONParseInternal : public NaryBaseIterator<JSONParseInternal, PlanIteratorState> | 42 | class JSONtoXMLInternal : public NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState> |
598 | 43 | { | 43 | { |
599 | 44 | public: | 44 | public: |
601 | 45 | SERIALIZABLE_CLASS(JSONParseInternal); | 45 | SERIALIZABLE_CLASS(JSONtoXMLInternal); |
602 | 46 | 46 | ||
605 | 47 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONParseInternal, | 47 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONtoXMLInternal, |
606 | 48 | NaryBaseIterator<JSONParseInternal, PlanIteratorState>); | 48 | NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>); |
607 | 49 | 49 | ||
608 | 50 | void serialize( ::zorba::serialization::Archiver& ar); | 50 | void serialize( ::zorba::serialization::Archiver& ar); |
609 | 51 | 51 | ||
611 | 52 | JSONParseInternal( | 52 | JSONtoXMLInternal( |
612 | 53 | static_context* sctx, | 53 | static_context* sctx, |
613 | 54 | const QueryLoc& loc, | 54 | const QueryLoc& loc, |
614 | 55 | std::vector<PlanIter_t>& children) | 55 | std::vector<PlanIter_t>& children) |
615 | 56 | : | 56 | : |
617 | 57 | NaryBaseIterator<JSONParseInternal, PlanIteratorState>(sctx, loc, children) | 57 | NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>(sctx, loc, children) |
618 | 58 | {} | 58 | {} |
619 | 59 | 59 | ||
621 | 60 | virtual ~JSONParseInternal(); | 60 | virtual ~JSONtoXMLInternal(); |
622 | 61 | 61 | ||
623 | 62 | void accept(PlanIterVisitor& v) const; | 62 | void accept(PlanIterVisitor& v) const; |
624 | 63 | 63 | ||
625 | @@ -71,25 +71,25 @@ | |||
626 | 71 | * | 71 | * |
627 | 72 | * Author: Zorba Team | 72 | * Author: Zorba Team |
628 | 73 | */ | 73 | */ |
630 | 74 | class JSONSerializeInternal : public NaryBaseIterator<JSONSerializeInternal, PlanIteratorState> | 74 | class XMLtoJSONInternal : public NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState> |
631 | 75 | { | 75 | { |
632 | 76 | public: | 76 | public: |
634 | 77 | SERIALIZABLE_CLASS(JSONSerializeInternal); | 77 | SERIALIZABLE_CLASS(XMLtoJSONInternal); |
635 | 78 | 78 | ||
638 | 79 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONSerializeInternal, | 79 | SERIALIZABLE_CLASS_CONSTRUCTOR2T(XMLtoJSONInternal, |
639 | 80 | NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>); | 80 | NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>); |
640 | 81 | 81 | ||
641 | 82 | void serialize( ::zorba::serialization::Archiver& ar); | 82 | void serialize( ::zorba::serialization::Archiver& ar); |
642 | 83 | 83 | ||
644 | 84 | JSONSerializeInternal( | 84 | XMLtoJSONInternal( |
645 | 85 | static_context* sctx, | 85 | static_context* sctx, |
646 | 86 | const QueryLoc& loc, | 86 | const QueryLoc& loc, |
647 | 87 | std::vector<PlanIter_t>& children) | 87 | std::vector<PlanIter_t>& children) |
648 | 88 | : | 88 | : |
650 | 89 | NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>(sctx, loc, children) | 89 | NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>(sctx, loc, children) |
651 | 90 | {} | 90 | {} |
652 | 91 | 91 | ||
654 | 92 | virtual ~JSONSerializeInternal(); | 92 | virtual ~XMLtoJSONInternal(); |
655 | 93 | 93 | ||
656 | 94 | void accept(PlanIterVisitor& v) const; | 94 | void accept(PlanIterVisitor& v) const; |
657 | 95 | 95 | ||
658 | 96 | 96 | ||
659 | === modified file 'src/runtime/pregenerated/iterator_enum.h' | |||
660 | --- src/runtime/pregenerated/iterator_enum.h 2013-06-08 05:33:57 +0000 | |||
661 | +++ src/runtime/pregenerated/iterator_enum.h 2013-07-11 06:16:30 +0000 | |||
662 | @@ -162,8 +162,8 @@ | |||
663 | 162 | TYPE_OptionIterator, | 162 | TYPE_OptionIterator, |
664 | 163 | TYPE_FunctionAnnotationsIterator, | 163 | TYPE_FunctionAnnotationsIterator, |
665 | 164 | TYPE_MemSizeIterator, | 164 | TYPE_MemSizeIterator, |
668 | 165 | TYPE_JSONParseInternal, | 165 | TYPE_JSONtoXMLInternal, |
669 | 166 | TYPE_JSONSerializeInternal, | 166 | TYPE_XMLtoJSONInternal, |
670 | 167 | TYPE_JSONDecodeFromRoundtripIterator, | 167 | TYPE_JSONDecodeFromRoundtripIterator, |
671 | 168 | TYPE_JSONEncodeForRoundtripIterator, | 168 | TYPE_JSONEncodeForRoundtripIterator, |
672 | 169 | TYPE_JSONParseIterator, | 169 | TYPE_JSONParseIterator, |
673 | 170 | 170 | ||
674 | === modified file 'src/runtime/spec/json/json.xml' | |||
675 | --- src/runtime/spec/json/json.xml 2011-12-16 19:36:24 +0000 | |||
676 | +++ src/runtime/spec/json/json.xml 2013-07-11 06:16:30 +0000 | |||
677 | @@ -13,14 +13,14 @@ | |||
678 | 13 | /******************************************************************************* | 13 | /******************************************************************************* |
679 | 14 | *******************************************************************************/ | 14 | *******************************************************************************/ |
680 | 15 | --> | 15 | --> |
682 | 16 | <zorba:iterator name="JSONParseInternal" arity="nary"> | 16 | <zorba:iterator name="JSONtoXMLInternal" arity="nary"> |
683 | 17 | 17 | ||
684 | 18 | <zorba:description author="Zorba Team"> | 18 | <zorba:description author="Zorba Team"> |
685 | 19 | function for parsing strings into json-xdm | 19 | function for parsing strings into json-xdm |
686 | 20 | </zorba:description> | 20 | </zorba:description> |
687 | 21 | 21 | ||
688 | 22 | <zorba:function isDeterministic="true"> | 22 | <zorba:function isDeterministic="true"> |
690 | 23 | <zorba:signature localname="parse-internal" prefix="fn-zorba-json"> | 23 | <zorba:signature localname="json-to-xml-internal" prefix="fn-zorba-json"> |
691 | 24 | <zorba:param>xs:string</zorba:param> | 24 | <zorba:param>xs:string</zorba:param> |
692 | 25 | <zorba:param>item()?</zorba:param> | 25 | <zorba:param>item()?</zorba:param> |
693 | 26 | <zorba:output>element()*</zorba:output> | 26 | <zorba:output>element()*</zorba:output> |
694 | @@ -33,14 +33,14 @@ | |||
695 | 33 | /******************************************************************************* | 33 | /******************************************************************************* |
696 | 34 | *******************************************************************************/ | 34 | *******************************************************************************/ |
697 | 35 | --> | 35 | --> |
699 | 36 | <zorba:iterator name="JSONSerializeInternal" arity="nary"> | 36 | <zorba:iterator name="XMLtoJSONInternal" arity="nary"> |
700 | 37 | 37 | ||
701 | 38 | <zorba:description author="Zorba Team"> | 38 | <zorba:description author="Zorba Team"> |
702 | 39 | Function to serialize json/jsonml xdm to string | 39 | Function to serialize json/jsonml xdm to string |
703 | 40 | </zorba:description> | 40 | </zorba:description> |
704 | 41 | 41 | ||
705 | 42 | <zorba:function isDeterministic="true"> | 42 | <zorba:function isDeterministic="true"> |
707 | 43 | <zorba:signature localname="serialize-internal" prefix="fn-zorba-json"> | 43 | <zorba:signature localname="xml-to-json-internal" prefix="fn-zorba-json"> |
708 | 44 | <zorba:param>item()*</zorba:param> | 44 | <zorba:param>item()*</zorba:param> |
709 | 45 | <zorba:param>item()?</zorba:param> | 45 | <zorba:param>item()?</zorba:param> |
710 | 46 | <zorba:output>xs:string</zorba:output> | 46 | <zorba:output>xs:string</zorba:output> |
711 | 47 | 47 | ||
712 | === modified file 'src/runtime/spec/mappings.xml' | |||
713 | --- src/runtime/spec/mappings.xml 2013-07-04 22:17:19 +0000 | |||
714 | +++ src/runtime/spec/mappings.xml 2013-07-11 06:16:30 +0000 | |||
715 | @@ -118,7 +118,7 @@ | |||
716 | 118 | define="ZORBA_URI_FN_NS" | 118 | define="ZORBA_URI_FN_NS" |
717 | 119 | prefix="fn-zorba-uri"/> | 119 | prefix="fn-zorba-uri"/> |
718 | 120 | 120 | ||
720 | 121 | <zorba:namespace uri="http://www.zorba-xquery.com/modules/converters/json" | 121 | <zorba:namespace uri="http://zorba.io/modules/json-xml" |
721 | 122 | define="ZORBA_JSON_FN_NS" | 122 | define="ZORBA_JSON_FN_NS" |
722 | 123 | prefix="fn-zorba-json"/> | 123 | prefix="fn-zorba-json"/> |
723 | 124 | 124 | ||
724 | 125 | 125 | ||
725 | === modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h' | |||
726 | --- src/runtime/visitors/pregenerated/planiter_visitor.h 2013-06-08 05:33:57 +0000 | |||
727 | +++ src/runtime/visitors/pregenerated/planiter_visitor.h 2013-07-11 06:16:30 +0000 | |||
728 | @@ -330,9 +330,9 @@ | |||
729 | 330 | 330 | ||
730 | 331 | class MemSizeIterator; | 331 | class MemSizeIterator; |
731 | 332 | 332 | ||
733 | 333 | class JSONParseInternal; | 333 | class JSONtoXMLInternal; |
734 | 334 | 334 | ||
736 | 335 | class JSONSerializeInternal; | 335 | class XMLtoJSONInternal; |
737 | 336 | 336 | ||
738 | 337 | class JSONDecodeFromRoundtripIterator; | 337 | class JSONDecodeFromRoundtripIterator; |
739 | 338 | 338 | ||
740 | @@ -1207,11 +1207,11 @@ | |||
741 | 1207 | virtual void beginVisit ( const MemSizeIterator& ) = 0; | 1207 | virtual void beginVisit ( const MemSizeIterator& ) = 0; |
742 | 1208 | virtual void endVisit ( const MemSizeIterator& ) = 0; | 1208 | virtual void endVisit ( const MemSizeIterator& ) = 0; |
743 | 1209 | 1209 | ||
746 | 1210 | virtual void beginVisit ( const JSONParseInternal& ) = 0; | 1210 | virtual void beginVisit ( const JSONtoXMLInternal& ) = 0; |
747 | 1211 | virtual void endVisit ( const JSONParseInternal& ) = 0; | 1211 | virtual void endVisit ( const JSONtoXMLInternal& ) = 0; |
748 | 1212 | 1212 | ||
751 | 1213 | virtual void beginVisit ( const JSONSerializeInternal& ) = 0; | 1213 | virtual void beginVisit ( const XMLtoJSONInternal& ) = 0; |
752 | 1214 | virtual void endVisit ( const JSONSerializeInternal& ) = 0; | 1214 | virtual void endVisit ( const XMLtoJSONInternal& ) = 0; |
753 | 1215 | 1215 | ||
754 | 1216 | virtual void beginVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; | 1216 | virtual void beginVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; |
755 | 1217 | virtual void endVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; | 1217 | virtual void endVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; |
756 | 1218 | 1218 | ||
757 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp' | |||
758 | --- src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-06-08 05:33:57 +0000 | |||
759 | +++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-07-11 06:16:30 +0000 | |||
760 | @@ -1985,32 +1985,32 @@ | |||
761 | 1985 | // </MemSizeIterator> | 1985 | // </MemSizeIterator> |
762 | 1986 | 1986 | ||
763 | 1987 | 1987 | ||
790 | 1988 | // <JSONParseInternal> | 1988 | // <JSONtoXMLInternal> |
791 | 1989 | void PrinterVisitor::beginVisit ( const JSONParseInternal& a) { | 1989 | void PrinterVisitor::beginVisit ( const JSONtoXMLInternal& a) { |
792 | 1990 | thePrinter.startBeginVisit("JSONParseInternal", ++theId); | 1990 | thePrinter.startBeginVisit("JSONtoXMLInternal", ++theId); |
793 | 1991 | printCommons( &a, theId ); | 1991 | printCommons( &a, theId ); |
794 | 1992 | thePrinter.endBeginVisit( theId ); | 1992 | thePrinter.endBeginVisit( theId ); |
795 | 1993 | } | 1993 | } |
796 | 1994 | 1994 | ||
797 | 1995 | void PrinterVisitor::endVisit ( const JSONParseInternal& ) { | 1995 | void PrinterVisitor::endVisit ( const JSONtoXMLInternal& ) { |
798 | 1996 | thePrinter.startEndVisit(); | 1996 | thePrinter.startEndVisit(); |
799 | 1997 | thePrinter.endEndVisit(); | 1997 | thePrinter.endEndVisit(); |
800 | 1998 | } | 1998 | } |
801 | 1999 | // </JSONParseInternal> | 1999 | // </JSONtoXMLInternal> |
802 | 2000 | 2000 | ||
803 | 2001 | 2001 | ||
804 | 2002 | // <JSONSerializeInternal> | 2002 | // <XMLtoJSONInternal> |
805 | 2003 | void PrinterVisitor::beginVisit ( const JSONSerializeInternal& a) { | 2003 | void PrinterVisitor::beginVisit ( const XMLtoJSONInternal& a) { |
806 | 2004 | thePrinter.startBeginVisit("JSONSerializeInternal", ++theId); | 2004 | thePrinter.startBeginVisit("XMLtoJSONInternal", ++theId); |
807 | 2005 | printCommons( &a, theId ); | 2005 | printCommons( &a, theId ); |
808 | 2006 | thePrinter.endBeginVisit( theId ); | 2006 | thePrinter.endBeginVisit( theId ); |
809 | 2007 | } | 2007 | } |
810 | 2008 | 2008 | ||
811 | 2009 | void PrinterVisitor::endVisit ( const JSONSerializeInternal& ) { | 2009 | void PrinterVisitor::endVisit ( const XMLtoJSONInternal& ) { |
812 | 2010 | thePrinter.startEndVisit(); | 2010 | thePrinter.startEndVisit(); |
813 | 2011 | thePrinter.endEndVisit(); | 2011 | thePrinter.endEndVisit(); |
814 | 2012 | } | 2012 | } |
815 | 2013 | // </JSONSerializeInternal> | 2013 | // </XMLtoJSONInternal> |
816 | 2014 | 2014 | ||
817 | 2015 | 2015 | ||
818 | 2016 | // <JSONDecodeFromRoundtripIterator> | 2016 | // <JSONDecodeFromRoundtripIterator> |
819 | 2017 | 2017 | ||
820 | === modified file 'src/runtime/visitors/pregenerated/printer_visitor.h' | |||
821 | --- src/runtime/visitors/pregenerated/printer_visitor.h 2013-06-08 05:33:57 +0000 | |||
822 | +++ src/runtime/visitors/pregenerated/printer_visitor.h 2013-07-11 06:16:30 +0000 | |||
823 | @@ -505,11 +505,11 @@ | |||
824 | 505 | void beginVisit( const MemSizeIterator& ); | 505 | void beginVisit( const MemSizeIterator& ); |
825 | 506 | void endVisit ( const MemSizeIterator& ); | 506 | void endVisit ( const MemSizeIterator& ); |
826 | 507 | 507 | ||
829 | 508 | void beginVisit( const JSONParseInternal& ); | 508 | void beginVisit( const JSONtoXMLInternal& ); |
830 | 509 | void endVisit ( const JSONParseInternal& ); | 509 | void endVisit ( const JSONtoXMLInternal& ); |
831 | 510 | 510 | ||
834 | 511 | void beginVisit( const JSONSerializeInternal& ); | 511 | void beginVisit( const XMLtoJSONInternal& ); |
835 | 512 | void endVisit ( const JSONSerializeInternal& ); | 512 | void endVisit ( const XMLtoJSONInternal& ); |
836 | 513 | 513 | ||
837 | 514 | void beginVisit( const JSONDecodeFromRoundtripIterator& ); | 514 | void beginVisit( const JSONDecodeFromRoundtripIterator& ); |
838 | 515 | void endVisit ( const JSONDecodeFromRoundtripIterator& ); | 515 | void endVisit ( const JSONDecodeFromRoundtripIterator& ); |
839 | 516 | 516 | ||
840 | === modified file 'test/rbkt/Queries/CMakeLists.txt' | |||
841 | --- test/rbkt/Queries/CMakeLists.txt 2013-06-18 11:51:57 +0000 | |||
842 | +++ test/rbkt/Queries/CMakeLists.txt 2013-07-11 06:16:30 +0000 | |||
843 | @@ -583,3 +583,4 @@ | |||
844 | 583 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_04.jq 1067028) | 583 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_04.jq 1067028) |
845 | 584 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_05.jq 1067028) | 584 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_05.jq 1067028) |
846 | 585 | 585 | ||
847 | 586 | EXPECTED_FAILURE(test/rbkt/zorba/json/json-invalid-option-parameter 1200089) | ||
848 | 586 | 587 | ||
849 | === modified file 'test/rbkt/Queries/zorba/error/data-location-json-2.xq' | |||
850 | --- test/rbkt/Queries/zorba/error/data-location-json-2.xq 2013-06-25 03:55:20 +0000 | |||
851 | +++ test/rbkt/Queries/zorba/error/data-location-json-2.xq 2013-07-11 06:16:30 +0000 | |||
852 | @@ -1,12 +1,12 @@ | |||
853 | 1 | import module namespace file = "http://expath.org/ns/file"; | 1 | import module namespace file = "http://expath.org/ns/file"; |
855 | 2 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 2 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
856 | 3 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; | 3 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
857 | 4 | 4 | ||
858 | 5 | let $file := "$RBKT_SRC_DIR/Queries/zorba/error/data-location.json" | 5 | let $file := "$RBKT_SRC_DIR/Queries/zorba/error/data-location.json" |
859 | 6 | let $json := file:read-text( $file ) | 6 | let $json := file:read-text( $file ) |
860 | 7 | return | 7 | return |
861 | 8 | try { | 8 | try { |
863 | 9 | json:parse( $json ) | 9 | jx:json-to-xml( $json ) |
864 | 10 | } | 10 | } |
865 | 11 | catch * { | 11 | catch * { |
866 | 12 | file:base-name( $zerr:data-uri ), | 12 | file:base-name( $zerr:data-uri ), |
867 | 13 | 13 | ||
868 | === modified file 'test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq' | |||
869 | --- test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq 2012-01-24 01:20:54 +0000 | |||
870 | +++ test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq 2013-07-11 06:16:30 +0000 | |||
871 | @@ -1,10 +1,6 @@ | |||
872 | 1 | (: try parsing a valid JSON string with invalid JSON option parameter :) | 1 | (: try parsing a valid JSON string with invalid JSON option parameter :) |
873 | 2 | 2 | ||
882 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
883 | 4 | 4 | ||
884 | 5 | let $options := | 5 | let $options := { "json-format" : "array" } |
885 | 6 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 6 | return jx:json-to-xml('{}',$options) |
878 | 7 | <json-format value="array"/> | ||
879 | 8 | </options> | ||
880 | 9 | |||
881 | 10 | return json:parse('{}',$options) | ||
886 | 11 | 7 | ||
887 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq' | |||
888 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2013-02-07 17:24:36 +0000 | |||
889 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2013-07-11 06:16:30 +0000 | |||
890 | @@ -1,10 +1,7 @@ | |||
892 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
893 | 2 | 2 | ||
894 | 3 | let $json := '[ "li", "list item" ]' | 3 | let $json := '[ "li", "list item" ]' |
900 | 4 | let $options := | 4 | let $options := { "json-format" : "JsonML-array" } |
901 | 5 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 5 | return jx:json-to-xml( $json, $options ) |
897 | 6 | <json-format value="JsonML-array"/> | ||
898 | 7 | </options> | ||
899 | 8 | return json:parse( $json, $options ) | ||
902 | 9 | 6 | ||
903 | 10 | (: vim:set et sw=2 ts=2: :) | 7 | (: vim:set et sw=2 ts=2: :) |
904 | 11 | 8 | ||
905 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq' | |||
906 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2013-02-07 17:24:36 +0000 | |||
907 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2013-07-11 06:16:30 +0000 | |||
908 | @@ -1,4 +1,4 @@ | |||
910 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
911 | 2 | 2 | ||
912 | 3 | let $json := ' | 3 | let $json := ' |
913 | 4 | [ "ul", | 4 | [ "ul", |
914 | @@ -6,10 +6,7 @@ | |||
915 | 6 | [ "li", "list item 2" ] | 6 | [ "li", "list item 2" ] |
916 | 7 | ] | 7 | ] |
917 | 8 | ' | 8 | ' |
923 | 9 | let $options := | 9 | let $options := { "json-format" : "JsonML-array" } |
924 | 10 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 10 | return jx:json-to-xml( $json, $options ) |
920 | 11 | <json-format value="JsonML-array"/> | ||
921 | 12 | </options> | ||
922 | 13 | return json:parse( $json, $options ) | ||
925 | 14 | 11 | ||
926 | 15 | (: vim:set et sw=2 ts=2: :) | 12 | (: vim:set et sw=2 ts=2: :) |
927 | 16 | 13 | ||
928 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq' | |||
929 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2013-02-07 17:24:36 +0000 | |||
930 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2013-07-11 06:16:30 +0000 | |||
931 | @@ -1,4 +1,4 @@ | |||
933 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
934 | 2 | 2 | ||
935 | 3 | let $json := ' | 3 | let $json := ' |
936 | 4 | [ "file", | 4 | [ "file", |
937 | @@ -10,10 +10,7 @@ | |||
938 | 10 | } | 10 | } |
939 | 11 | ] | 11 | ] |
940 | 12 | ' | 12 | ' |
946 | 13 | let $options := | 13 | let $options := { "json-format" : "JsonML-array" } |
947 | 14 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 14 | return jx:json-to-xml( $json, $options ) |
943 | 15 | <json-format value="JsonML-array"/> | ||
944 | 16 | </options> | ||
945 | 17 | return json:parse( $json, $options ) | ||
948 | 18 | 15 | ||
949 | 19 | (: vim:set et sw=2 ts=2: :) | 16 | (: vim:set et sw=2 ts=2: :) |
950 | 20 | 17 | ||
951 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq' | |||
952 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2013-02-07 17:24:36 +0000 | |||
953 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2013-07-11 06:16:30 +0000 | |||
954 | @@ -1,4 +1,4 @@ | |||
956 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
957 | 2 | 2 | ||
958 | 3 | let $json := ' | 3 | let $json := ' |
959 | 4 | [ "ul", | 4 | [ "ul", |
960 | @@ -21,10 +21,7 @@ | |||
961 | 21 | " Item" | 21 | " Item" |
962 | 22 | ] | 22 | ] |
963 | 23 | ]' | 23 | ]' |
969 | 24 | let $options := | 24 | let $options := { "json-format" : "JsonML-array" } |
970 | 25 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 25 | return jx:json-to-xml( $json, $options ) |
966 | 26 | <json-format value="JsonML-array"/> | ||
967 | 27 | </options> | ||
968 | 28 | return json:parse( $json, $options ) | ||
971 | 29 | 26 | ||
972 | 30 | (: vim:se et sw=2 ts=2: :) | 27 | (: vim:se et sw=2 ts=2: :) |
973 | 31 | 28 | ||
974 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq' | |||
975 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2013-02-07 17:24:36 +0000 | |||
976 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2013-07-11 06:16:30 +0000 | |||
977 | @@ -1,4 +1,4 @@ | |||
979 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
980 | 2 | 2 | ||
981 | 3 | let $json := '["table", | 3 | let $json := '["table", |
982 | 4 | { | 4 | { |
983 | @@ -59,10 +59,7 @@ | |||
984 | 59 | ] | 59 | ] |
985 | 60 | ] | 60 | ] |
986 | 61 | ]' | 61 | ]' |
992 | 62 | let $options := | 62 | let $options := { "json-format" : "JsonML-array" } |
993 | 63 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 63 | return jx:json-to-xml( $json, $options ) |
989 | 64 | <json-format value="JsonML-array"/> | ||
990 | 65 | </options> | ||
991 | 66 | return json:parse( $json, $options ) | ||
994 | 67 | 64 | ||
995 | 68 | (: vim:se et sw=2 ts=2: :) | 65 | (: vim:se et sw=2 ts=2: :) |
996 | 69 | 66 | ||
997 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq' | |||
998 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2013-02-07 17:24:36 +0000 | |||
999 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2013-07-11 06:16:30 +0000 | |||
1000 | @@ -1,11 +1,8 @@ | |||
1001 | 1 | (: try parsing an empty value :) | 1 | (: try parsing an empty value :) |
1002 | 2 | 2 | ||
1004 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1005 | 4 | 4 | ||
1011 | 5 | let $options := | 5 | let $options := { "json-format" : "JsonML-array" } |
1012 | 6 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 6 | return jx:json-to-xml( <a/>, $options ) |
1008 | 7 | <json-format value="JsonML-array"/> | ||
1009 | 8 | </options> | ||
1010 | 9 | return json:parse( <a/>, $options ) | ||
1013 | 10 | 7 | ||
1014 | 11 | (: vim:set et sw=2 ts=2: :) | 8 | (: vim:set et sw=2 ts=2: :) |
1015 | 12 | 9 | ||
1016 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq' | |||
1017 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq 2012-05-13 15:33:57 +0000 | |||
1018 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq 2013-07-11 06:16:30 +0000 | |||
1019 | @@ -1,14 +1,11 @@ | |||
1022 | 1 | import module namespace json = | 1 | import module namespace jx = |
1023 | 2 | "http://www.zorba-xquery.com/modules/converters/json"; | 2 | "http://zorba.io/modules/json-xml"; |
1024 | 3 | 3 | ||
1029 | 4 | let $opt := | 4 | let $options := { "json-format" : "JsonML-array" } |
1026 | 5 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | ||
1027 | 6 | <json-format value="JsonML-array"/> | ||
1028 | 7 | </options> | ||
1030 | 8 | let $json := | 5 | let $json := |
1031 | 9 | '{ | 6 | '{ |
1032 | 10 | "args": [ "<div><span>foo:</span> parse</div>" ] | 7 | "args": [ "<div><span>foo:</span> parse</div>" ] |
1033 | 11 | }' | 8 | }' |
1035 | 12 | return json:parse( $json, $opt ) | 9 | return jx:json-to-xml( $json, $options ) |
1036 | 13 | 10 | ||
1037 | 14 | (: vim:set et sw=2 ts=2: :) | 11 | (: vim:set et sw=2 ts=2: :) |
1038 | 15 | 12 | ||
1039 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq' | |||
1040 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq 2013-04-02 02:48:56 +0000 | |||
1041 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq 2013-07-11 06:16:30 +0000 | |||
1042 | @@ -1,11 +1,8 @@ | |||
1045 | 1 | import module namespace json = | 1 | import module namespace jx = |
1046 | 2 | "http://www.zorba-xquery.com/modules/converters/json"; | 2 | "http://zorba.io/modules/json-xml"; |
1047 | 3 | 3 | ||
1052 | 4 | let $opt := | 4 | let $options := { "json-format" : "JsonML-array" } |
1049 | 5 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | ||
1050 | 6 | <json-format value="JsonML-array"/> | ||
1051 | 7 | </options> | ||
1053 | 8 | let $json := '[ { "x" : "x" } ]' | 5 | let $json := '[ { "x" : "x" } ]' |
1055 | 9 | return json:parse( $json, $opt ) | 6 | return jx:json-to-xml( $json, $options ) |
1056 | 10 | 7 | ||
1057 | 11 | (: vim:set et sw=2 ts=2: :) | 8 | (: vim:set et sw=2 ts=2: :) |
1058 | 12 | 9 | ||
1059 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq' | |||
1060 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2013-02-07 17:24:36 +0000 | |||
1061 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2013-07-11 06:16:30 +0000 | |||
1062 | @@ -1,4 +1,4 @@ | |||
1064 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1065 | 2 | 2 | ||
1066 | 3 | let $json := ' | 3 | let $json := ' |
1067 | 4 | [ "person", | 4 | [ "person", |
1068 | @@ -15,10 +15,7 @@ | |||
1069 | 15 | ] | 15 | ] |
1070 | 16 | ] | 16 | ] |
1071 | 17 | ' | 17 | ' |
1077 | 18 | let $options := | 18 | let $options := { "json-format" : "JsonML-array" } |
1078 | 19 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 19 | return jx:json-to-xml( $json, $options ) |
1074 | 20 | <json-format value="JsonML-array"/> | ||
1075 | 21 | </options> | ||
1076 | 22 | return json:parse( $json, $options ) | ||
1079 | 23 | 20 | ||
1080 | 24 | (: vim:set et sw=2 ts=2: :) | 21 | (: vim:set et sw=2 ts=2: :) |
1081 | 25 | 22 | ||
1082 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq' | |||
1083 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2013-02-07 17:24:36 +0000 | |||
1084 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2013-07-11 06:16:30 +0000 | |||
1085 | @@ -1,11 +1,8 @@ | |||
1087 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1088 | 2 | 2 | ||
1089 | 3 | let $json := | 3 | let $json := |
1090 | 4 | <li>list item</li> | 4 | <li>list item</li> |
1096 | 5 | let $options := | 5 | let $options := { "json-format" : "JsonML-array" } |
1097 | 6 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 6 | return jx:xml-to-json( $json, $options ) |
1093 | 7 | <json-format value="JsonML-array"/> | ||
1094 | 8 | </options> | ||
1095 | 9 | return json:serialize( $json, $options ) | ||
1098 | 10 | 7 | ||
1099 | 11 | (: vim:set et sw=2 ts=2: :) | 8 | (: vim:set et sw=2 ts=2: :) |
1100 | 12 | 9 | ||
1101 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq' | |||
1102 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2013-02-07 17:24:36 +0000 | |||
1103 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2013-07-11 06:16:30 +0000 | |||
1104 | @@ -1,14 +1,11 @@ | |||
1106 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1107 | 2 | 2 | ||
1108 | 3 | let $json := | 3 | let $json := |
1109 | 4 | <ul> | 4 | <ul> |
1110 | 5 | <li>list item 1</li> | 5 | <li>list item 1</li> |
1111 | 6 | <li>list item 2</li> | 6 | <li>list item 2</li> |
1112 | 7 | </ul> | 7 | </ul> |
1118 | 8 | let $options := | 8 | let $options := { "json-format" : "JsonML-array" } |
1119 | 9 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 9 | return jx:xml-to-json( $json, $options ) |
1115 | 10 | <json-format value="JsonML-array"/> | ||
1116 | 11 | </options> | ||
1117 | 12 | return json:serialize( $json, $options ) | ||
1120 | 13 | 10 | ||
1121 | 14 | (: vim:set et sw=2 ts=2: :) | 11 | (: vim:set et sw=2 ts=2: :) |
1122 | 15 | 12 | ||
1123 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq' | |||
1124 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2013-02-07 17:24:36 +0000 | |||
1125 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2013-07-11 06:16:30 +0000 | |||
1126 | @@ -1,11 +1,8 @@ | |||
1128 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1129 | 2 | 2 | ||
1130 | 3 | let $json := | 3 | let $json := |
1131 | 4 | <file dir="/tmp" name="foo" size="1234" modified="2006-12-31T23:59"/> | 4 | <file dir="/tmp" name="foo" size="1234" modified="2006-12-31T23:59"/> |
1137 | 5 | let $options := | 5 | let $options := { "json-format" : "JsonML-array" } |
1138 | 6 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 6 | return jx:xml-to-json( $json, $options ) |
1134 | 7 | <json-format value="JsonML-array"/> | ||
1135 | 8 | </options> | ||
1136 | 9 | return json:serialize( $json, $options ) | ||
1139 | 10 | 7 | ||
1140 | 11 | (: vim:set et sw=2 ts=2: :) | 8 | (: vim:set et sw=2 ts=2: :) |
1141 | 12 | 9 | ||
1142 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq' | |||
1143 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2013-02-07 17:24:36 +0000 | |||
1144 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2013-07-11 06:16:30 +0000 | |||
1145 | @@ -1,4 +1,4 @@ | |||
1147 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1148 | 2 | 2 | ||
1149 | 3 | let $json := | 3 | let $json := |
1150 | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1151 | @@ -11,11 +11,7 @@ | |||
1152 | 11 | <postalCode>98765-4321</postalCode> | 11 | <postalCode>98765-4321</postalCode> |
1153 | 12 | </address> | 12 | </address> |
1154 | 13 | </person> | 13 | </person> |
1161 | 14 | let $options := | 14 | let $options := { "json-format" : "JsonML-array", "whitespace" : "indent" } |
1162 | 15 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 15 | return jx:xml-to-json( $json, $options ) |
1157 | 16 | <json-format value="JsonML-array"/> | ||
1158 | 17 | <whitespace value="indent"/> | ||
1159 | 18 | </options> | ||
1160 | 19 | return json:serialize( $json, $options ) | ||
1163 | 20 | 16 | ||
1164 | 21 | (: vim:set et sw=2 ts=2: :) | 17 | (: vim:set et sw=2 ts=2: :) |
1165 | 22 | 18 | ||
1166 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq' | |||
1167 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2013-02-07 17:24:36 +0000 | |||
1168 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2013-07-11 06:16:30 +0000 | |||
1169 | @@ -1,4 +1,4 @@ | |||
1171 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1172 | 2 | 2 | ||
1173 | 3 | let $json := | 3 | let $json := |
1174 | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1175 | @@ -11,10 +11,7 @@ | |||
1176 | 11 | <postalCode>98765-4321</postalCode> | 11 | <postalCode>98765-4321</postalCode> |
1177 | 12 | </address> | 12 | </address> |
1178 | 13 | </person> | 13 | </person> |
1184 | 14 | let $options := | 14 | let $options := { "json-format" : "JsonML-array" } |
1185 | 15 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 15 | return jx:xml-to-json( $json, $options ) |
1181 | 16 | <json-format value="JsonML-array"/> | ||
1182 | 17 | </options> | ||
1183 | 18 | return json:serialize( $json, $options ) | ||
1186 | 19 | 16 | ||
1187 | 20 | (: vim:set et sw=2 ts=2: :) | 17 | (: vim:set et sw=2 ts=2: :) |
1188 | 21 | 18 | ||
1189 | === modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq' | |||
1190 | --- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2013-02-07 17:24:36 +0000 | |||
1191 | +++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2013-07-11 06:16:30 +0000 | |||
1192 | @@ -1,4 +1,4 @@ | |||
1194 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1195 | 2 | 2 | ||
1196 | 3 | let $json := | 3 | let $json := |
1197 | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> | 4 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1198 | @@ -11,11 +11,7 @@ | |||
1199 | 11 | <postalCode>98765-4321</postalCode> | 11 | <postalCode>98765-4321</postalCode> |
1200 | 12 | </address> | 12 | </address> |
1201 | 13 | </person> | 13 | </person> |
1208 | 14 | let $options := | 14 | let $options := { "json-format" : "JsonML-array", "whitespace" : "some" } |
1209 | 15 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 15 | return jx:xml-to-json( $json, $options ) |
1204 | 16 | <json-format value="JsonML-array"/> | ||
1205 | 17 | <whitespace value="some"/> | ||
1206 | 18 | </options> | ||
1207 | 19 | return json:serialize( $json, $options ) | ||
1210 | 20 | 16 | ||
1211 | 21 | (: vim:set et sw=2 ts=2: :) | 17 | (: vim:set et sw=2 ts=2: :) |
1212 | 22 | 18 | ||
1213 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq' | |||
1214 | --- test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq 2012-01-23 23:22:52 +0000 | |||
1215 | +++ test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq 2013-07-11 06:16:30 +0000 | |||
1216 | @@ -1,6 +1,6 @@ | |||
1218 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1219 | 2 | 2 | ||
1221 | 3 | json:parse('[ "ul", | 3 | jx:json-to-xml('[ "ul", |
1222 | 4 | [ "li", true], | 4 | [ "li", true], |
1223 | 5 | [ "li", | 5 | [ "li", |
1224 | 6 | {"href":"driving.html", "title":"Driving"}, | 6 | {"href":"driving.html", "title":"Driving"}, |
1225 | 7 | 7 | ||
1226 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq' | |||
1227 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2013-02-07 17:24:36 +0000 | |||
1228 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2013-07-11 06:16:30 +0000 | |||
1229 | @@ -1,6 +1,6 @@ | |||
1231 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1232 | 2 | 2 | ||
1233 | 3 | let $json := '[ true ]' | 3 | let $json := '[ true ]' |
1235 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1236 | 5 | 5 | ||
1237 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1238 | 7 | 7 | ||
1239 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq' | |||
1240 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2013-02-07 17:24:36 +0000 | |||
1241 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2013-07-11 06:16:30 +0000 | |||
1242 | @@ -1,6 +1,6 @@ | |||
1244 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1245 | 2 | 2 | ||
1246 | 3 | let $json := '[ false ]' | 3 | let $json := '[ false ]' |
1248 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1249 | 5 | 5 | ||
1250 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1251 | 7 | 7 | ||
1252 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq' | |||
1253 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2013-02-07 17:24:36 +0000 | |||
1254 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2013-07-11 06:16:30 +0000 | |||
1255 | @@ -1,6 +1,6 @@ | |||
1257 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1258 | 2 | 2 | ||
1259 | 3 | let $json := '[ null ]' | 3 | let $json := '[ null ]' |
1261 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1262 | 5 | 5 | ||
1263 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1264 | 7 | 7 | ||
1265 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq' | |||
1266 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2013-02-07 17:24:36 +0000 | |||
1267 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2013-07-11 06:16:30 +0000 | |||
1268 | @@ -1,6 +1,6 @@ | |||
1270 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1271 | 2 | 2 | ||
1272 | 3 | let $json := '[ 1 ]' | 3 | let $json := '[ 1 ]' |
1274 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1275 | 5 | 5 | ||
1276 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1277 | 7 | 7 | ||
1278 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq' | |||
1279 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2013-02-07 17:24:36 +0000 | |||
1280 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2013-07-11 06:16:30 +0000 | |||
1281 | @@ -1,6 +1,6 @@ | |||
1283 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1284 | 2 | 2 | ||
1285 | 3 | let $json := '[ 1, 2 ]' | 3 | let $json := '[ 1, 2 ]' |
1287 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1288 | 5 | 5 | ||
1289 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1290 | 7 | 7 | ||
1291 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq' | |||
1292 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq 2012-01-26 01:35:11 +0000 | |||
1293 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq 2013-07-11 06:16:30 +0000 | |||
1294 | @@ -1,7 +1,7 @@ | |||
1295 | 1 | (: parse a JSON array composed of 2 JSON objects :) | 1 | (: parse a JSON array composed of 2 JSON objects :) |
1296 | 2 | 2 | ||
1298 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1299 | 4 | 4 | ||
1301 | 5 | json:parse( '[ { "key1": "value1" }, { "key2": "value2" } ]' ) | 5 | jx:json-to-xml( '[ { "key1": "value1" }, { "key2": "value2" } ]' ) |
1302 | 6 | 6 | ||
1303 | 7 | (: vim:set et sw=2 ts=2: :) | 7 | (: vim:set et sw=2 ts=2: :) |
1304 | 8 | 8 | ||
1305 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq' | |||
1306 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2013-02-07 17:24:36 +0000 | |||
1307 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2013-07-11 06:16:30 +0000 | |||
1308 | @@ -1,7 +1,7 @@ | |||
1309 | 1 | (: parse an JSON array composed of 2 JSON arrays :) | 1 | (: parse an JSON array composed of 2 JSON arrays :) |
1310 | 2 | 2 | ||
1312 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1313 | 4 | 4 | ||
1315 | 5 | json:parse( '[ [ 11, 12 ], [ 21, 22 ] ]' ) | 5 | jx:json-to-xml( '[ [ 11, 12 ], [ 21, 22 ] ]' ) |
1316 | 6 | 6 | ||
1317 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1318 | 8 | 8 | ||
1319 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq' | |||
1320 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq 2012-02-08 01:15:26 +0000 | |||
1321 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq 2013-07-11 06:16:30 +0000 | |||
1322 | @@ -1,7 +1,7 @@ | |||
1325 | 1 | import module namespace json = | 1 | import module namespace jx = |
1326 | 2 | "http://www.zorba-xquery.com/modules/converters/json"; | 2 | "http://zorba.io/modules/json-xml"; |
1327 | 3 | 3 | ||
1328 | 4 | let $json := '[ 1, { "foo": "bar" } ]' | 4 | let $json := '[ 1, { "foo": "bar" } ]' |
1330 | 5 | return json:parse( $json ) | 5 | return jx:json-to-xml( $json ) |
1331 | 6 | 6 | ||
1332 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1333 | 8 | 8 | ||
1334 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq' | |||
1335 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2013-02-07 17:24:36 +0000 | |||
1336 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2013-07-11 06:16:30 +0000 | |||
1337 | @@ -1,7 +1,7 @@ | |||
1338 | 1 | (: try parsing an empty value :) | 1 | (: try parsing an empty value :) |
1339 | 2 | 2 | ||
1341 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1342 | 4 | 4 | ||
1344 | 5 | json:parse( <a/> ) | 5 | jx:json-to-xml( <a/> ) |
1345 | 6 | 6 | ||
1346 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1347 | 8 | 8 | ||
1348 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq' | |||
1349 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2013-02-07 17:24:36 +0000 | |||
1350 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2013-07-11 06:16:30 +0000 | |||
1351 | @@ -1,4 +1,4 @@ | |||
1353 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1354 | 2 | 2 | ||
1355 | 3 | let $json := ' | 3 | let $json := ' |
1356 | 4 | { | 4 | { |
1357 | @@ -16,6 +16,6 @@ | |||
1358 | 16 | ] | 16 | ] |
1359 | 17 | } | 17 | } |
1360 | 18 | ' | 18 | ' |
1362 | 19 | return json:parse( $json ) | 19 | return jx:json-to-xml( $json ) |
1363 | 20 | 20 | ||
1364 | 21 | (: vim:set et sw=2 ts=2: :) | 21 | (: vim:set et sw=2 ts=2: :) |
1365 | 22 | 22 | ||
1366 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq' | |||
1367 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 2013-02-07 17:24:36 +0000 | |||
1368 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 2013-07-11 06:16:30 +0000 | |||
1369 | @@ -1,8 +1,8 @@ | |||
1375 | 1 | (: json:parse testing numbers :) | 1 | (: jx:json-to-xml testing numbers :) |
1376 | 2 | 2 | ||
1377 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1378 | 4 | 4 | ||
1379 | 5 | json:parse( '{ | 5 | jx:json-to-xml( '{ |
1380 | 6 | "decimal": 2.89, | 6 | "decimal": 2.89, |
1381 | 7 | "e": 2E+6, | 7 | "e": 2E+6, |
1382 | 8 | "negative": -1.89 | 8 | "negative": -1.89 |
1383 | 9 | 9 | ||
1384 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq' | |||
1385 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2013-02-07 17:24:36 +0000 | |||
1386 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2013-07-11 06:16:30 +0000 | |||
1387 | @@ -1,6 +1,6 @@ | |||
1389 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1390 | 2 | 2 | ||
1391 | 3 | let $json := '{ "a" : 1 }' | 3 | let $json := '{ "a" : 1 }' |
1393 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1394 | 5 | 5 | ||
1395 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1396 | 7 | 7 | ||
1397 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq' | |||
1398 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2013-02-07 17:24:36 +0000 | |||
1399 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2013-07-11 06:16:30 +0000 | |||
1400 | @@ -1,6 +1,6 @@ | |||
1402 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1403 | 2 | 2 | ||
1404 | 3 | let $json := '{ "a" : 1, "b" : 2 }' | 3 | let $json := '{ "a" : 1, "b" : 2 }' |
1406 | 4 | return json:parse( $json ) | 4 | return jx:json-to-xml( $json ) |
1407 | 5 | 5 | ||
1408 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1409 | 7 | 7 | ||
1410 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq' | |||
1411 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq 2012-02-08 15:45:53 +0000 | |||
1412 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq 2013-07-11 06:16:30 +0000 | |||
1413 | @@ -1,7 +1,7 @@ | |||
1416 | 1 | import module namespace json = | 1 | import module namespace jx = |
1417 | 2 | "http://www.zorba-xquery.com/modules/converters/json"; | 2 | "http://zorba.io/modules/json-xml"; |
1418 | 3 | 3 | ||
1419 | 4 | let $json := '{ "k1" : [ { "k2" : "v2" }, null ] }' | 4 | let $json := '{ "k1" : [ { "k2" : "v2" }, null ] }' |
1421 | 5 | return json:parse( $json ) | 5 | return jx:json-to-xml( $json ) |
1422 | 6 | 6 | ||
1423 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1424 | 8 | 8 | ||
1425 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq' | |||
1426 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq 2012-02-13 17:25:08 +0000 | |||
1427 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq 2013-07-11 06:16:30 +0000 | |||
1428 | @@ -1,5 +1,5 @@ | |||
1431 | 1 | import module namespace json = | 1 | import module namespace jx = |
1432 | 2 | "http://www.zorba-xquery.com/modules/converters/json"; | 2 | "http://zorba.io/modules/json-xml"; |
1433 | 3 | 3 | ||
1434 | 4 | let $json := ' | 4 | let $json := ' |
1435 | 5 | { | 5 | { |
1436 | @@ -7,6 +7,6 @@ | |||
1437 | 7 | "key2": "value" | 7 | "key2": "value" |
1438 | 8 | } | 8 | } |
1439 | 9 | ' | 9 | ' |
1441 | 10 | return json:parse( $json ) | 10 | return jx:json-to-xml( $json ) |
1442 | 11 | 11 | ||
1443 | 12 | (: vim:se et sw=2 ts=2: :) | 12 | (: vim:se et sw=2 ts=2: :) |
1444 | 13 | 13 | ||
1445 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq' | |||
1446 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 2013-02-07 17:24:36 +0000 | |||
1447 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 2013-07-11 06:16:30 +0000 | |||
1448 | @@ -1,7 +1,7 @@ | |||
1454 | 1 | (: json:parse testing null as a key value :) | 1 | (: jx:json-to-xml testing null as a key value :) |
1455 | 2 | 2 | ||
1456 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1457 | 4 | 4 | ||
1458 | 5 | json:parse( '{ "a" : null }' ) | 5 | jx:json-to-xml( '{ "a" : null }' ) |
1459 | 6 | 6 | ||
1460 | 7 | (: vim:set et sw=2 ts=2: :) | 7 | (: vim:set et sw=2 ts=2: :) |
1461 | 8 | 8 | ||
1462 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq' | |||
1463 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2013-02-07 17:24:36 +0000 | |||
1464 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2013-07-11 06:16:30 +0000 | |||
1465 | @@ -1,10 +1,10 @@ | |||
1467 | 1 | import module namespace json="http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx="http://zorba.io/modules/json-xml"; |
1468 | 2 | 2 | ||
1469 | 3 | declare variable $json-element := | 3 | declare variable $json-element := |
1470 | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1471 | 5 | <pair name="html" type="string"><b>bold</b></pair> | 5 | <pair name="html" type="string"><b>bold</b></pair> |
1472 | 6 | </json>; | 6 | </json>; |
1473 | 7 | 7 | ||
1475 | 8 | json:parse( json:serialize( $json-element ) ) | 8 | jx:json-to-xml( jx:xml-to-json( $json-element ) ) |
1476 | 9 | 9 | ||
1477 | 10 | (: vim:se et sw=2 ts=2: :) | 10 | (: vim:se et sw=2 ts=2: :) |
1478 | 11 | 11 | ||
1479 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq' | |||
1480 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 2013-02-07 17:24:36 +0000 | |||
1481 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 2013-07-11 06:16:30 +0000 | |||
1482 | @@ -1,7 +1,7 @@ | |||
1488 | 1 | (: json:parse with uncommon characters :) | 1 | (: jx:json-to-xml with uncommon characters :) |
1489 | 2 | 2 | ||
1490 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1491 | 4 | 4 | ||
1492 | 5 | json:parse( '{ "web-app" : "!_\"-\\?*.$+" }' ) | 5 | jx:json-to-xml( '{ "web-app" : "!_\"-\\?*.$+" }' ) |
1493 | 6 | 6 | ||
1494 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1495 | 8 | 8 | ||
1496 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq' | |||
1497 | --- test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 2013-02-07 17:24:36 +0000 | |||
1498 | +++ test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 2013-07-11 06:16:30 +0000 | |||
1499 | @@ -1,5 +1,5 @@ | |||
1500 | 1 | (: try parsing a Unicode UTF-8 value :) | 1 | (: try parsing a Unicode UTF-8 value :) |
1501 | 2 | 2 | ||
1503 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1504 | 4 | 4 | ||
1506 | 5 | json:parse( '{ "mdash": "–" }' ) | 5 | jx:json-to-xml( '{ "mdash": "–" }' ) |
1507 | 6 | 6 | ||
1508 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq' | |||
1509 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2013-02-07 17:24:36 +0000 | |||
1510 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2013-07-11 06:16:30 +0000 | |||
1511 | @@ -1,9 +1,9 @@ | |||
1513 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1514 | 2 | 2 | ||
1515 | 3 | let $json := | 3 | let $json := |
1516 | 4 | <json type="array"> | 4 | <json type="array"> |
1517 | 5 | <item type="boolean">true</item> | 5 | <item type="boolean">true</item> |
1518 | 6 | </json> | 6 | </json> |
1520 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1521 | 8 | 8 | ||
1522 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1523 | 10 | 10 | ||
1524 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq' | |||
1525 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2013-02-07 17:24:36 +0000 | |||
1526 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2013-07-11 06:16:30 +0000 | |||
1527 | @@ -1,9 +1,9 @@ | |||
1529 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1530 | 2 | 2 | ||
1531 | 3 | let $json := | 3 | let $json := |
1532 | 4 | <json type="array"> | 4 | <json type="array"> |
1533 | 5 | <item type="boolean">false</item> | 5 | <item type="boolean">false</item> |
1534 | 6 | </json> | 6 | </json> |
1536 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1537 | 8 | 8 | ||
1538 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1539 | 10 | 10 | ||
1540 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq' | |||
1541 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2013-02-07 17:24:36 +0000 | |||
1542 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2013-07-11 06:16:30 +0000 | |||
1543 | @@ -1,9 +1,9 @@ | |||
1545 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1546 | 2 | 2 | ||
1547 | 3 | let $json := | 3 | let $json := |
1548 | 4 | <json type="array"> | 4 | <json type="array"> |
1549 | 5 | <item type="null"/> | 5 | <item type="null"/> |
1550 | 6 | </json> | 6 | </json> |
1552 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1553 | 8 | 8 | ||
1554 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1555 | 10 | 10 | ||
1556 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq' | |||
1557 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2013-02-07 17:24:36 +0000 | |||
1558 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2013-07-11 06:16:30 +0000 | |||
1559 | @@ -1,9 +1,9 @@ | |||
1561 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1562 | 2 | 2 | ||
1563 | 3 | let $json := | 3 | let $json := |
1564 | 4 | <json type="array"> | 4 | <json type="array"> |
1565 | 5 | <item type="number">1</item> | 5 | <item type="number">1</item> |
1566 | 6 | </json> | 6 | </json> |
1568 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1569 | 8 | 8 | ||
1570 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1571 | 10 | 10 | ||
1572 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq' | |||
1573 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2013-02-07 17:24:36 +0000 | |||
1574 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2013-07-11 06:16:30 +0000 | |||
1575 | @@ -1,10 +1,10 @@ | |||
1577 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1578 | 2 | 2 | ||
1579 | 3 | let $json := | 3 | let $json := |
1580 | 4 | <json type="array"> | 4 | <json type="array"> |
1581 | 5 | <item type="number">1</item> | 5 | <item type="number">1</item> |
1582 | 6 | <item type="number">2</item> | 6 | <item type="number">2</item> |
1583 | 7 | </json> | 7 | </json> |
1585 | 8 | return json:serialize( $json ) | 8 | return jx:xml-to-json( $json ) |
1586 | 9 | 9 | ||
1587 | 10 | (: vim:set et sw=2 ts=2: :) | 10 | (: vim:set et sw=2 ts=2: :) |
1588 | 11 | 11 | ||
1589 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq' | |||
1590 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2013-02-07 17:24:36 +0000 | |||
1591 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2013-07-11 06:16:30 +0000 | |||
1592 | @@ -1,9 +1,9 @@ | |||
1594 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1595 | 2 | 2 | ||
1596 | 3 | let $json := | 3 | let $json := |
1597 | 4 | <json type="array"> | 4 | <json type="array"> |
1598 | 5 | <foo type="boolean">true</foo> | 5 | <foo type="boolean">true</foo> |
1599 | 6 | </json> | 6 | </json> |
1601 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1602 | 8 | 8 | ||
1603 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1604 | 10 | 10 | ||
1605 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq' | |||
1606 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2013-02-07 17:24:36 +0000 | |||
1607 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2013-07-11 06:16:30 +0000 | |||
1608 | @@ -1,9 +1,9 @@ | |||
1610 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1611 | 2 | 2 | ||
1612 | 3 | let $json := | 3 | let $json := |
1613 | 4 | <json type="array"> | 4 | <json type="array"> |
1614 | 5 | <item type="boolean">foo</item> | 5 | <item type="boolean">foo</item> |
1615 | 6 | </json> | 6 | </json> |
1617 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1618 | 8 | 8 | ||
1619 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1620 | 10 | 10 | ||
1621 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq' | |||
1622 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2013-02-07 17:24:36 +0000 | |||
1623 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2013-07-11 06:16:30 +0000 | |||
1624 | @@ -1,9 +1,9 @@ | |||
1626 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1627 | 2 | 2 | ||
1628 | 3 | let $json := | 3 | let $json := |
1629 | 4 | <json type="array"> | 4 | <json type="array"> |
1630 | 5 | <item>false</item> | 5 | <item>false</item> |
1631 | 6 | </json> | 6 | </json> |
1633 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1634 | 8 | 8 | ||
1635 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1636 | 10 | 10 | ||
1637 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq' | |||
1638 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2013-02-07 17:24:36 +0000 | |||
1639 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2013-07-11 06:16:30 +0000 | |||
1640 | @@ -1,9 +1,9 @@ | |||
1642 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1643 | 2 | 2 | ||
1644 | 3 | let $json := | 3 | let $json := |
1645 | 4 | <json type="array"> | 4 | <json type="array"> |
1646 | 5 | <item type="bool">false</item> | 5 | <item type="bool">false</item> |
1647 | 6 | </json> | 6 | </json> |
1649 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1650 | 8 | 8 | ||
1651 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1652 | 10 | 10 | ||
1653 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq' | |||
1654 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2013-02-07 17:24:36 +0000 | |||
1655 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2013-07-11 06:16:30 +0000 | |||
1656 | @@ -1,9 +1,9 @@ | |||
1658 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1659 | 2 | 2 | ||
1660 | 3 | let $json := | 3 | let $json := |
1661 | 4 | <json type="array"> | 4 | <json type="array"> |
1662 | 5 | hello | 5 | hello |
1663 | 6 | </json> | 6 | </json> |
1665 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1666 | 8 | 8 | ||
1667 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1668 | 10 | 10 | ||
1669 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq' | |||
1670 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2013-02-07 17:24:36 +0000 | |||
1671 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2013-07-11 06:16:30 +0000 | |||
1672 | @@ -1,9 +1,9 @@ | |||
1674 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1675 | 2 | 2 | ||
1676 | 3 | let $json := | 3 | let $json := |
1677 | 4 | <json type="array"> | 4 | <json type="array"> |
1678 | 5 | <item type="boolean"><foo/></item> | 5 | <item type="boolean"><foo/></item> |
1679 | 6 | </json> | 6 | </json> |
1681 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1682 | 8 | 8 | ||
1683 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1684 | 10 | 10 | ||
1685 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq' | |||
1686 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2013-02-07 17:24:36 +0000 | |||
1687 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2013-07-11 06:16:30 +0000 | |||
1688 | @@ -1,12 +1,12 @@ | |||
1689 | 1 | (: valid json generation: comments should be ignored :) | 1 | (: valid json generation: comments should be ignored :) |
1690 | 2 | 2 | ||
1692 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1693 | 4 | 4 | ||
1694 | 5 | let $json := | 5 | let $json := |
1695 | 6 | <json type="array"> | 6 | <json type="array"> |
1696 | 7 | <!--comment--> | 7 | <!--comment--> |
1697 | 8 | <item type="boolean">true</item> | 8 | <item type="boolean">true</item> |
1698 | 9 | </json> | 9 | </json> |
1700 | 10 | return json:serialize( $json ) | 10 | return jx:xml-to-json( $json ) |
1701 | 11 | 11 | ||
1702 | 12 | (: vim:set et sw=2 ts=2: :) | 12 | (: vim:set et sw=2 ts=2: :) |
1703 | 13 | 13 | ||
1704 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq' | |||
1705 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2013-02-07 17:24:36 +0000 | |||
1706 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2013-07-11 06:16:30 +0000 | |||
1707 | @@ -1,6 +1,6 @@ | |||
1709 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1710 | 2 | 2 | ||
1711 | 3 | let $json := <!--comment--> | 3 | let $json := <!--comment--> |
1713 | 4 | return json:serialize( $json ) | 4 | return jx:xml-to-json( $json ) |
1714 | 5 | 5 | ||
1715 | 6 | (: vim:set et sw=2 ts=2: :) | 6 | (: vim:set et sw=2 ts=2: :) |
1716 | 7 | 7 | ||
1717 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq' | |||
1718 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2013-02-07 17:24:36 +0000 | |||
1719 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2013-07-11 06:16:30 +0000 | |||
1720 | @@ -1,4 +1,4 @@ | |||
1722 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1723 | 2 | 2 | ||
1724 | 3 | let $json := | 3 | let $json := |
1725 | 4 | <json type="object"> | 4 | <json type="object"> |
1726 | @@ -15,11 +15,7 @@ | |||
1727 | 15 | <item type="string">646 123-4567</item> | 15 | <item type="string">646 123-4567</item> |
1728 | 16 | </pair> | 16 | </pair> |
1729 | 17 | </json> | 17 | </json> |
1736 | 18 | let $options := | 18 | let $options := { "json-format" : "Snelson", "whitespace" : "indent" } |
1737 | 19 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 19 | return jx:xml-to-json( $json, $options ) |
1732 | 20 | <json-format value="Snelson"/> | ||
1733 | 21 | <whitespace value="indent"/> | ||
1734 | 22 | </options> | ||
1735 | 23 | return json:serialize( $json, $options ) | ||
1738 | 24 | 20 | ||
1739 | 25 | (: vim:set et sw=2 ts=2: :) | 21 | (: vim:set et sw=2 ts=2: :) |
1740 | 26 | 22 | ||
1741 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq' | |||
1742 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2013-02-07 17:24:36 +0000 | |||
1743 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2013-07-11 06:16:30 +0000 | |||
1744 | @@ -1,9 +1,9 @@ | |||
1746 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1747 | 2 | 2 | ||
1748 | 3 | let $json := | 3 | let $json := |
1749 | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1750 | 5 | <pair name="a" type="nothing">a</pair> | 5 | <pair name="a" type="nothing">a</pair> |
1751 | 6 | </json> | 6 | </json> |
1753 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1754 | 8 | 8 | ||
1755 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1756 | 10 | 10 | ||
1757 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq' | |||
1758 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2013-02-07 17:24:36 +0000 | |||
1759 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2013-07-11 06:16:30 +0000 | |||
1760 | @@ -1,4 +1,4 @@ | |||
1762 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1763 | 2 | 2 | ||
1764 | 3 | let $json := | 3 | let $json := |
1765 | 4 | <json type="object"> | 4 | <json type="object"> |
1766 | @@ -15,6 +15,6 @@ | |||
1767 | 15 | <item type="string">646 123-4567</item> | 15 | <item type="string">646 123-4567</item> |
1768 | 16 | </pair> | 16 | </pair> |
1769 | 17 | </json> | 17 | </json> |
1771 | 18 | return json:serialize( $json ) | 18 | return jx:xml-to-json( $json ) |
1772 | 19 | 19 | ||
1773 | 20 | (: vim:set et sw=2 ts=2: :) | 20 | (: vim:set et sw=2 ts=2: :) |
1774 | 21 | 21 | ||
1775 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq' | |||
1776 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2013-02-07 17:24:36 +0000 | |||
1777 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2013-07-11 06:16:30 +0000 | |||
1778 | @@ -1,9 +1,9 @@ | |||
1780 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1781 | 2 | 2 | ||
1782 | 3 | let $json := | 3 | let $json := |
1783 | 4 | <json type="object"> | 4 | <json type="object"> |
1784 | 5 | <pair name="a" type="number">1</pair> | 5 | <pair name="a" type="number">1</pair> |
1785 | 6 | </json> | 6 | </json> |
1787 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1788 | 8 | 8 | ||
1789 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1790 | 10 | 10 | ||
1791 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq' | |||
1792 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2013-02-07 17:24:36 +0000 | |||
1793 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2013-07-11 06:16:30 +0000 | |||
1794 | @@ -1,10 +1,10 @@ | |||
1796 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1797 | 2 | 2 | ||
1798 | 3 | let $json := | 3 | let $json := |
1799 | 4 | <json type="object"> | 4 | <json type="object"> |
1800 | 5 | <pair name="a" type="number">1</pair> | 5 | <pair name="a" type="number">1</pair> |
1801 | 6 | <pair name="b" type="number">2</pair> | 6 | <pair name="b" type="number">2</pair> |
1802 | 7 | </json> | 7 | </json> |
1804 | 8 | return json:serialize( $json ) | 8 | return jx:xml-to-json( $json ) |
1805 | 9 | 9 | ||
1806 | 10 | (: vim:set et sw=2 ts=2: :) | 10 | (: vim:set et sw=2 ts=2: :) |
1807 | 11 | 11 | ||
1808 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq' | |||
1809 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2013-02-07 17:24:36 +0000 | |||
1810 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2013-07-11 06:16:30 +0000 | |||
1811 | @@ -1,6 +1,6 @@ | |||
1812 | 1 | (: valid json generation: comments should be ignored :) | 1 | (: valid json generation: comments should be ignored :) |
1813 | 2 | 2 | ||
1815 | 3 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1816 | 4 | 4 | ||
1817 | 5 | let $json := | 5 | let $json := |
1818 | 6 | <json type="object"> | 6 | <json type="object"> |
1819 | @@ -8,6 +8,6 @@ | |||
1820 | 8 | <pair name="a" type="number">1</pair> | 8 | <pair name="a" type="number">1</pair> |
1821 | 9 | <!--comment--> | 9 | <!--comment--> |
1822 | 10 | </json> | 10 | </json> |
1824 | 11 | return json:serialize( $json ) | 11 | return jx:xml-to-json( $json ) |
1825 | 12 | 12 | ||
1826 | 13 | (: vim:set et sw=2 ts=2: :) | 13 | (: vim:set et sw=2 ts=2: :) |
1827 | 14 | 14 | ||
1828 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq' | |||
1829 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2013-02-07 17:24:36 +0000 | |||
1830 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2013-07-11 06:16:30 +0000 | |||
1831 | @@ -1,7 +1,7 @@ | |||
1833 | 1 | import module namespace json="http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx="http://zorba.io/modules/json-xml"; |
1834 | 2 | 2 | ||
1835 | 3 | declare variable $json-value := '{ "key" : "value" }'; | 3 | declare variable $json-value := '{ "key" : "value" }'; |
1836 | 4 | 4 | ||
1838 | 5 | json:serialize( json:parse( $json-value ) ) | 5 | jx:xml-to-json( jx:json-to-xml( $json-value ) ) |
1839 | 6 | 6 | ||
1840 | 7 | (: vim:se et sw=2 ts=2: :) | 7 | (: vim:se et sw=2 ts=2: :) |
1841 | 8 | 8 | ||
1842 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq' | |||
1843 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2013-02-07 17:24:36 +0000 | |||
1844 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2013-07-11 06:16:30 +0000 | |||
1845 | @@ -1,4 +1,4 @@ | |||
1847 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1848 | 2 | 2 | ||
1849 | 3 | let $json := | 3 | let $json := |
1850 | 4 | <json type="object"> | 4 | <json type="object"> |
1851 | @@ -15,11 +15,7 @@ | |||
1852 | 15 | <item type="string">646 123-4567</item> | 15 | <item type="string">646 123-4567</item> |
1853 | 16 | </pair> | 16 | </pair> |
1854 | 17 | </json> | 17 | </json> |
1861 | 18 | let $options := | 18 | let $options := { "json-format" : "Snelson", "whitespace" : "some" } |
1862 | 19 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> | 19 | return jx:xml-to-json( $json, $options ) |
1857 | 20 | <json-format value="Snelson"/> | ||
1858 | 21 | <whitespace value="some"/> | ||
1859 | 22 | </options> | ||
1860 | 23 | return json:serialize( $json, $options ) | ||
1863 | 24 | 20 | ||
1864 | 25 | (: vim:set et sw=2 ts=2: :) | 21 | (: vim:set et sw=2 ts=2: :) |
1865 | 26 | 22 | ||
1866 | === modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq' | |||
1867 | --- test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2013-02-07 17:24:36 +0000 | |||
1868 | +++ test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2013-07-11 06:16:30 +0000 | |||
1869 | @@ -1,9 +1,9 @@ | |||
1871 | 1 | import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; | 1 | import module namespace jx = "http://zorba.io/modules/json-xml"; |
1872 | 2 | 2 | ||
1873 | 3 | let $json := | 3 | let $json := |
1874 | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> | 4 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1875 | 5 | <pair name="a">a</pair> | 5 | <pair name="a">a</pair> |
1876 | 6 | </json> | 6 | </json> |
1878 | 7 | return json:serialize( $json ) | 7 | return jx:xml-to-json( $json ) |
1879 | 8 | 8 | ||
1880 | 9 | (: vim:set et sw=2 ts=2: :) | 9 | (: vim:set et sw=2 ts=2: :) |
1881 | 10 | 10 | ||
1882 | === modified file 'test/update/Queries/zorba/store/sc3_ex3.xq' | |||
1883 | --- test/update/Queries/zorba/store/sc3_ex3.xq 2013-02-07 17:24:36 +0000 | |||
1884 | +++ test/update/Queries/zorba/store/sc3_ex3.xq 2013-07-11 06:16:30 +0000 | |||
1885 | @@ -1,10 +1,8 @@ | |||
1886 | 1 | import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents"; | 1 | import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents"; |
1887 | 2 | 2 | ||
1889 | 3 | import module namespace j = "http://www.zorba-xquery.com/modules/converters/json"; | 3 | import module namespace j = "http://zorba.io/modules/json-xml"; |
1890 | 4 | 4 | ||
1892 | 5 | j:serialize( | 5 | j:xml-to-json( |
1893 | 6 | doc:document("meat_poultry.xml")/root/row, | 6 | doc:document("meat_poultry.xml")/root/row, |
1897 | 7 | <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > | 7 | { "json-format" : "JsonML-array" } |
1895 | 8 | <json-format value="JsonML-array" /> | ||
1896 | 9 | </options> | ||
1898 | 10 | ) | 8 | ) |
Validation queue starting for the following merge proposals: /code.launchpad .net/~zorba- coders/ zorba/bug- 1189786- json-update/ +merge/ 174085
https:/
Progress dashboard at http:// jenkins. lambda. nu/view/ ValidationQueue