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 | ADD_SUBDIRECTORY(xqxq) |
6 | ADD_SUBDIRECTORY(w3c) |
7 | ADD_SUBDIRECTORY(full-text) |
8 | +ADD_SUBDIRECTORY(json) |
9 | ADD_SUBDIRECTORY(nodes) |
10 | |
11 | # Add external module projects - any subdirectories of a directory |
12 | |
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 | # Subdirectories |
18 | DECLARE_ZORBA_MODULE(FILE converters/base64.xq VERSION 2.0 |
19 | URI "http://www.zorba-xquery.com/modules/converters/base64") |
20 | -DECLARE_ZORBA_MODULE(FILE converters/json.xq VERSION 2.0 |
21 | - URI "http://www.zorba-xquery.com/modules/converters/json") |
22 | -DECLARE_ZORBA_SCHEMA(FILE converters/json-options.xsd |
23 | - URI "http://www.zorba-xquery.com/modules/converters/json-options") |
24 | DECLARE_ZORBA_MODULE(FILE introspection/sctx.xq VERSION 2.0 |
25 | URI "http://www.zorba-xquery.com/modules/introspection/sctx") |
26 | |
27 | |
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 | -<!-- |
33 | - ! Copyright 2006-2008 The FLWOR Foundation. |
34 | - ! |
35 | - ! Licensed under the Apache License, Version 2.0 (the "License"); |
36 | - ! you may not use this file except in compliance with the License. |
37 | - ! You may obtain a copy of the License at |
38 | - ! |
39 | - ! http://www.apache.org/licenses/LICENSE-2.0 |
40 | - ! |
41 | - ! Unless required by applicable law or agreed to in writing, software |
42 | - ! distributed under the License is distributed on an "AS IS" BASIS, |
43 | - ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
44 | - ! See the License for the specific language governing permissions and |
45 | - ! limitations under the License. |
46 | ---> |
47 | - |
48 | -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" |
49 | - xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options" |
50 | - targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options" |
51 | - elementFormDefault="qualified" |
52 | - attributeFormDefault="unqualified"> |
53 | - |
54 | - <xs:element name="options"> |
55 | - <xs:complexType> |
56 | - <xs:all> |
57 | - |
58 | - <xs:element name="json-format" minOccurs="1" maxOccurs="1"> |
59 | - <xs:complexType> |
60 | - <xs:attribute name="value" use="required"> |
61 | - <xs:simpleType> |
62 | - <xs:restriction base="xs:string"> |
63 | - <xs:enumeration value="Snelson"/> |
64 | - <xs:enumeration value="JsonML-array"/> |
65 | - <!-- <xs:enumeration value="JsonML-object"/> --> |
66 | - </xs:restriction> |
67 | - </xs:simpleType> |
68 | - </xs:attribute> |
69 | - </xs:complexType> |
70 | - </xs:element> |
71 | - |
72 | - <xs:element name="whitespace" minOccurs="0" maxOccurs="1"> |
73 | - <xs:complexType> |
74 | - <xs:attribute name="value" use="required"> |
75 | - <xs:simpleType> |
76 | - <xs:restriction base="xs:string"> |
77 | - <xs:enumeration value="none"/> |
78 | - <xs:enumeration value="some"/> |
79 | - <xs:enumeration value="indent"/> |
80 | - </xs:restriction> |
81 | - </xs:simpleType> |
82 | - </xs:attribute> |
83 | - </xs:complexType> |
84 | - </xs:element> |
85 | - |
86 | - </xs:all> |
87 | - </xs:complexType> |
88 | - </xs:element> |
89 | -</xs:schema> |
90 | - |
91 | -<!-- vim:set et sw=2 ts=2: --> |
92 | |
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 | +# Copyright 2013 The FLWOR Foundation. |
99 | +# |
100 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
101 | +# you may not use this file except in compliance with the License. |
102 | +# You may obtain a copy of the License at |
103 | +# |
104 | +# http://www.apache.org/licenses/LICENSE-2.0 |
105 | +# |
106 | +# Unless required by applicable law or agreed to in writing, software |
107 | +# distributed under the License is distributed on an "AS IS" BASIS, |
108 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
109 | +# See the License for the specific language governing permissions and |
110 | +# limitations under the License. |
111 | + |
112 | +DECLARE_ZORBA_MODULE(FILE json-xml.xq VERSION 1.0 |
113 | + URI "http://zorba.io/modules/json-xml") |
114 | |
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 | |
120 | (:~ |
121 | : Using this module, you can parse JSON data into XML, manipulate it like any |
122 | - : other XML data using XQuery, and serialize the result back as JSON. |
123 | + : other XML data using XQuery, and serialize the result back as JSON.<p/> |
124 | : |
125 | : There are many ways to represent JSON data in XML, some loss-less ("round |
126 | : tripable") and some lossy ("one way"). Loss-less representations preserve |
127 | @@ -93,34 +93,25 @@ |
128 | : @author Paul J. Lucas |
129 | : @project Zorba/Data Converters/JSON |
130 | :) |
131 | -module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
132 | - |
133 | -import module namespace schema = "http://www.zorba-xquery.com/modules/schema"; |
134 | - |
135 | -import schema namespace json-options = |
136 | - "http://www.zorba-xquery.com/modules/converters/json-options"; |
137 | +module namespace jx = "http://zorba.io/modules/json-xml"; |
138 | |
139 | declare namespace an = "http://www.zorba-xquery.com/annotations"; |
140 | declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
141 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
142 | |
143 | declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
144 | -declare option ver:module-version "2.0"; |
145 | +declare option ver:module-version "1.0"; |
146 | |
147 | (:~ |
148 | : Parses JSON data from a string and returns an XDM instance using one of the |
149 | - : representations described above. |
150 | + : representations described above.<p/> |
151 | : |
152 | : @param $json The JSON data to parse. |
153 | : @param $options The parsing options, for example: |
154 | : <pre> |
155 | - : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
156 | - : <json-format value="JsonML-array"/> |
157 | - : </options> |
158 | + : { "json-format" : "JsonML-array" } |
159 | : </pre> |
160 | : @return said XDM instance. |
161 | - : @error err:XQDY0027 if $options can not be validated against the |
162 | - : json-options schema. |
163 | : @error zerr:ZJPE0001 if $json contains an illegal JSON character. |
164 | : @error zerr:ZJPE0002 if $json contains an illegal Unicode code-point. |
165 | : @error zerr:ZJPE0003 if $json contains an illegal JSON character escape. |
166 | @@ -131,21 +122,17 @@ |
167 | : @error zerr:ZJPE0008 if $json contains an illegal QName. |
168 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq |
169 | :) |
170 | -declare function json:parse( |
171 | +declare function jx:json-to-xml( |
172 | $json as xs:string?, |
173 | - $options as element(json-options:options) |
174 | + $options as object() |
175 | ) as element(*,xs:untyped)* |
176 | { |
177 | - let $validated-options := if ( schema:is-validated( $options ) ) then |
178 | - $options |
179 | - else |
180 | - validate { $options } |
181 | - return json:parse-internal( $json, $validated-options ) |
182 | + jx:json-to-xml-internal( $json, $options ) |
183 | }; |
184 | |
185 | (:~ |
186 | : Parses JSON data from a string and returns an XDM instance using the Snelson |
187 | - : representation described above. |
188 | + : representation described above.<p/> |
189 | : |
190 | : @param $json The JSON data to parse. |
191 | : @return said XDM instance. |
192 | @@ -159,36 +146,25 @@ |
193 | : @error zerr:ZJPE0008 if $json contains an illegal QName. |
194 | : @example test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq |
195 | :) |
196 | -declare function json:parse( |
197 | +declare function jx:json-to-xml( |
198 | $json as xs:string? |
199 | ) as element(*,xs:untyped)* |
200 | { |
201 | - json:parse-internal( |
202 | - $json, |
203 | - validate { |
204 | - <options |
205 | - xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
206 | - <json-format value="Snelson"/> |
207 | - </options> |
208 | - } |
209 | + jx:json-to-xml-internal( |
210 | + $json, { "json-format" : "Snelson" } |
211 | ) |
212 | }; |
213 | |
214 | (:~ |
215 | : Serializes an XDM into JSON using one of the representations described |
216 | - : above. |
217 | + : above.<p/> |
218 | : |
219 | : @param $xml The XDM to serialize. |
220 | : @param $options The serializing options, for example: |
221 | : <pre> |
222 | - : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
223 | - : <json-format value="JsonML-array"/> |
224 | - : <whitespace value="indent"/> |
225 | - : </options> |
226 | + : { "json-format" : "JsonML-array", "whitespace" : "indent" } |
227 | : </pre> |
228 | : @return a JSON string. |
229 | - : @error err:XQDY0027 if $options can not be validated against the |
230 | - : json-options schema. |
231 | : @error zerr:ZJSE0001 if $xml is not a document or element node. |
232 | : @error zerr:ZJSE0002 if $xml contains an element that is missing a required |
233 | : attribute. |
234 | @@ -201,21 +177,17 @@ |
235 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. |
236 | : @example test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq |
237 | :) |
238 | -declare function json:serialize( |
239 | +declare function jx:xml-to-json( |
240 | $xml as item()*, |
241 | - $options as element(json-options:options) |
242 | + $options as object() |
243 | ) as xs:string |
244 | { |
245 | - let $validated-options := if ( schema:is-validated( $options ) ) then |
246 | - $options |
247 | - else |
248 | - validate { $options } |
249 | - return json:serialize-internal( $xml, $validated-options ) |
250 | + jx:xml-to-json-internal( $xml, $options ) |
251 | }; |
252 | |
253 | (:~ |
254 | : Serializes an XDM into JSON using one of the representations described |
255 | - : above. |
256 | + : above.<p/> |
257 | : |
258 | : @param $xml The XDM to serialize. |
259 | : @return a JSON string. |
260 | @@ -231,28 +203,21 @@ |
261 | : @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type. |
262 | : @example test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq |
263 | :) |
264 | -declare function json:serialize( |
265 | +declare function jx:xml-to-json( |
266 | $xml as item()* |
267 | ) as xs:string |
268 | { |
269 | - json:serialize-internal($xml, |
270 | - validate { |
271 | - <options |
272 | - xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
273 | - <json-format value="Snelson"/> |
274 | - </options> |
275 | - } |
276 | - ) |
277 | + jx:xml-to-json-internal($xml, { "json-format" : "Snelson" }) |
278 | }; |
279 | |
280 | (:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::) |
281 | |
282 | -declare %private function json:parse-internal( |
283 | +declare %private function jx:json-to-xml-internal( |
284 | $json as xs:string?, |
285 | $options as item()? |
286 | ) as element()* external; |
287 | |
288 | -declare %an:streamable %private function json:serialize-internal( |
289 | +declare %an:streamable %private function jx:xml-to-json-internal( |
290 | $xml as item()*, |
291 | $options as item()? |
292 | ) as xs:string external; |
293 | |
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 | |
299 | const char* |
300 | static_context::ZORBA_JSON_FN_NS = |
301 | -"http://www.zorba-xquery.com/modules/converters/json"; |
302 | +"http://zorba.io/modules/json-xml"; |
303 | |
304 | const char* |
305 | static_context::ZORBA_NODEREF_FN_NS = |
306 | |
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 | |
312 | |
313 | |
314 | -PlanIter_t fn_zorba_json_parse_internal::codegen( |
315 | +PlanIter_t fn_zorba_json_json_to_xml_internal::codegen( |
316 | CompilerCB*, |
317 | static_context* sctx, |
318 | const QueryLoc& loc, |
319 | std::vector<PlanIter_t>& argv, |
320 | expr& ann) const |
321 | { |
322 | - return new JSONParseInternal(sctx, loc, argv); |
323 | + return new JSONtoXMLInternal(sctx, loc, argv); |
324 | } |
325 | |
326 | -PlanIter_t fn_zorba_json_serialize_internal::codegen( |
327 | +PlanIter_t fn_zorba_json_xml_to_json_internal::codegen( |
328 | CompilerCB*, |
329 | static_context* sctx, |
330 | const QueryLoc& loc, |
331 | std::vector<PlanIter_t>& argv, |
332 | expr& ann) const |
333 | { |
334 | - return new JSONSerializeInternal(sctx, loc, argv); |
335 | + return new XMLtoJSONInternal(sctx, loc, argv); |
336 | } |
337 | |
338 | void populate_context_json(static_context* sctx) |
339 | @@ -56,12 +56,12 @@ |
340 | |
341 | |
342 | { |
343 | - DECL_WITH_KIND(sctx, fn_zorba_json_parse_internal, |
344 | - (createQName("http://www.zorba-xquery.com/modules/converters/json","","parse-internal"), |
345 | + DECL_WITH_KIND(sctx, fn_zorba_json_json_to_xml_internal, |
346 | + (createQName("http://zorba.io/modules/json-xml","","json-to-xml-internal"), |
347 | GENV_TYPESYSTEM.STRING_TYPE_ONE, |
348 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, |
349 | GENV_TYPESYSTEM.ELEMENT_TYPE_STAR), |
350 | - FunctionConsts::FN_ZORBA_JSON_PARSE_INTERNAL_2); |
351 | + FunctionConsts::FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2); |
352 | |
353 | } |
354 | |
355 | @@ -69,12 +69,12 @@ |
356 | |
357 | |
358 | { |
359 | - DECL_WITH_KIND(sctx, fn_zorba_json_serialize_internal, |
360 | - (createQName("http://www.zorba-xquery.com/modules/converters/json","","serialize-internal"), |
361 | + DECL_WITH_KIND(sctx, fn_zorba_json_xml_to_json_internal, |
362 | + (createQName("http://zorba.io/modules/json-xml","","xml-to-json-internal"), |
363 | GENV_TYPESYSTEM.ITEM_TYPE_STAR, |
364 | GENV_TYPESYSTEM.ITEM_TYPE_QUESTION, |
365 | GENV_TYPESYSTEM.STRING_TYPE_ONE), |
366 | - FunctionConsts::FN_ZORBA_JSON_SERIALIZE_INTERNAL_2); |
367 | + FunctionConsts::FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2); |
368 | |
369 | } |
370 | |
371 | |
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 | |
377 | |
378 | |
379 | -//fn-zorba-json:parse-internal |
380 | -class fn_zorba_json_parse_internal : public function |
381 | +//fn-zorba-json:json-to-xml-internal |
382 | +class fn_zorba_json_json_to_xml_internal : public function |
383 | { |
384 | public: |
385 | - fn_zorba_json_parse_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
386 | + fn_zorba_json_json_to_xml_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
387 | : |
388 | function(sig, kind) |
389 | { |
390 | @@ -53,11 +53,11 @@ |
391 | }; |
392 | |
393 | |
394 | -//fn-zorba-json:serialize-internal |
395 | -class fn_zorba_json_serialize_internal : public function |
396 | +//fn-zorba-json:xml-to-json-internal |
397 | +class fn_zorba_json_xml_to_json_internal : public function |
398 | { |
399 | public: |
400 | - fn_zorba_json_serialize_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
401 | + fn_zorba_json_xml_to_json_internal(const signature& sig, FunctionConsts::FunctionKind kind) |
402 | : |
403 | function(sig, kind) |
404 | { |
405 | |
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 | FN_ZORBA_INTROSPECT_SCTX_OPTION_1, |
411 | FN_ZORBA_INTROSPECT_SCTX_FUNCTION_ANNOTATIONS_2, |
412 | FN_ZORBA_ITEM_SIZE_1, |
413 | - FN_ZORBA_JSON_PARSE_INTERNAL_2, |
414 | - FN_ZORBA_JSON_SERIALIZE_INTERNAL_2, |
415 | + FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2, |
416 | + FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2, |
417 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_1, |
418 | FN_JSONIQ_DECODE_FROM_ROUNDTRIP_2, |
419 | FN_JSONIQ_ENCODE_FOR_ROUNDTRIP_1, |
420 | |
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 | |
426 | typedef map<zstring,zstring> options_type; |
427 | |
428 | -static void get_options( store::Item_t const &options_element, |
429 | +static void get_options( store::Item_t const &options_object, |
430 | options_type *options ) { |
431 | - ZORBA_ASSERT( options_element->getNodeKind() == |
432 | - store::StoreConsts::elementNode ); |
433 | - store::Iterator_t i = options_element->getChildren(); |
434 | + ZORBA_ASSERT( options_object->getKind() == store::Item::OBJECT ); |
435 | + store::Iterator_t i = options_object->getObjectKeys(); |
436 | i->open(); |
437 | - store::Item_t option_item; |
438 | - while ( i->next( option_item ) ) { |
439 | - if ( option_item->getNodeKind() == store::StoreConsts::elementNode ) { |
440 | - zstring const name( option_item->getNodeName()->getStringValue() ); |
441 | - zstring value; |
442 | - get_attribute_value( option_item, "value", &value ); |
443 | - (*options)[ name ] = value; |
444 | - } |
445 | + store::Item_t option_key; |
446 | + while ( i->next( option_key ) ) { |
447 | + zstring const name( option_key->getStringValue() ); |
448 | + (*options)[ name ] = options_object->getObjectValue(option_key)->getStringValue(); |
449 | } |
450 | i->close(); |
451 | } |
452 | |
453 | /////////////////////////////////////////////////////////////////////////////// |
454 | |
455 | -bool JSONParseInternal::nextImpl( store::Item_t& result, |
456 | +bool JSONtoXMLInternal::nextImpl( store::Item_t& result, |
457 | PlanState &planState ) const { |
458 | store::Item_t cur_item; |
459 | options_type options; |
460 | @@ -190,7 +185,7 @@ |
461 | |
462 | /////////////////////////////////////////////////////////////////////////////// |
463 | |
464 | -bool JSONSerializeInternal::nextImpl( store::Item_t& result, |
465 | +bool XMLtoJSONInternal::nextImpl( store::Item_t& result, |
466 | PlanState &planState ) const { |
467 | store::Item_t cur_item; |
468 | options_type options; |
469 | |
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 | |
475 | namespace zorba { |
476 | |
477 | -// <JSONParseInternal> |
478 | -SERIALIZABLE_CLASS_VERSIONS(JSONParseInternal) |
479 | - |
480 | -void JSONParseInternal::serialize(::zorba::serialization::Archiver& ar) |
481 | -{ |
482 | - serialize_baseclass(ar, |
483 | - (NaryBaseIterator<JSONParseInternal, PlanIteratorState>*)this); |
484 | -} |
485 | - |
486 | - |
487 | -void JSONParseInternal::accept(PlanIterVisitor& v) const |
488 | -{ |
489 | - v.beginVisit(*this); |
490 | - |
491 | - std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
492 | - std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
493 | - for ( ; lIter != lEnd; ++lIter ){ |
494 | - (*lIter)->accept(v); |
495 | - } |
496 | - |
497 | - v.endVisit(*this); |
498 | -} |
499 | - |
500 | -JSONParseInternal::~JSONParseInternal() {} |
501 | - |
502 | -// </JSONParseInternal> |
503 | - |
504 | - |
505 | -// <JSONSerializeInternal> |
506 | -SERIALIZABLE_CLASS_VERSIONS(JSONSerializeInternal) |
507 | - |
508 | -void JSONSerializeInternal::serialize(::zorba::serialization::Archiver& ar) |
509 | -{ |
510 | - serialize_baseclass(ar, |
511 | - (NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>*)this); |
512 | -} |
513 | - |
514 | - |
515 | -void JSONSerializeInternal::accept(PlanIterVisitor& v) const |
516 | -{ |
517 | - v.beginVisit(*this); |
518 | - |
519 | - std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
520 | - std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
521 | - for ( ; lIter != lEnd; ++lIter ){ |
522 | - (*lIter)->accept(v); |
523 | - } |
524 | - |
525 | - v.endVisit(*this); |
526 | -} |
527 | - |
528 | -JSONSerializeInternal::~JSONSerializeInternal() {} |
529 | - |
530 | -// </JSONSerializeInternal> |
531 | +// <JSONtoXMLInternal> |
532 | +SERIALIZABLE_CLASS_VERSIONS(JSONtoXMLInternal) |
533 | + |
534 | +void JSONtoXMLInternal::serialize(::zorba::serialization::Archiver& ar) |
535 | +{ |
536 | + serialize_baseclass(ar, |
537 | + (NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>*)this); |
538 | +} |
539 | + |
540 | + |
541 | +void JSONtoXMLInternal::accept(PlanIterVisitor& v) const |
542 | +{ |
543 | + v.beginVisit(*this); |
544 | + |
545 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
546 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
547 | + for ( ; lIter != lEnd; ++lIter ){ |
548 | + (*lIter)->accept(v); |
549 | + } |
550 | + |
551 | + v.endVisit(*this); |
552 | +} |
553 | + |
554 | +JSONtoXMLInternal::~JSONtoXMLInternal() {} |
555 | + |
556 | +// </JSONtoXMLInternal> |
557 | + |
558 | + |
559 | +// <XMLtoJSONInternal> |
560 | +SERIALIZABLE_CLASS_VERSIONS(XMLtoJSONInternal) |
561 | + |
562 | +void XMLtoJSONInternal::serialize(::zorba::serialization::Archiver& ar) |
563 | +{ |
564 | + serialize_baseclass(ar, |
565 | + (NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>*)this); |
566 | +} |
567 | + |
568 | + |
569 | +void XMLtoJSONInternal::accept(PlanIterVisitor& v) const |
570 | +{ |
571 | + v.beginVisit(*this); |
572 | + |
573 | + std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin(); |
574 | + std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end(); |
575 | + for ( ; lIter != lEnd; ++lIter ){ |
576 | + (*lIter)->accept(v); |
577 | + } |
578 | + |
579 | + v.endVisit(*this); |
580 | +} |
581 | + |
582 | +XMLtoJSONInternal::~XMLtoJSONInternal() {} |
583 | + |
584 | +// </XMLtoJSONInternal> |
585 | |
586 | |
587 | |
588 | |
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 | * |
594 | * Author: Zorba Team |
595 | */ |
596 | -class JSONParseInternal : public NaryBaseIterator<JSONParseInternal, PlanIteratorState> |
597 | +class JSONtoXMLInternal : public NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState> |
598 | { |
599 | public: |
600 | - SERIALIZABLE_CLASS(JSONParseInternal); |
601 | + SERIALIZABLE_CLASS(JSONtoXMLInternal); |
602 | |
603 | - SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONParseInternal, |
604 | - NaryBaseIterator<JSONParseInternal, PlanIteratorState>); |
605 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONtoXMLInternal, |
606 | + NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>); |
607 | |
608 | void serialize( ::zorba::serialization::Archiver& ar); |
609 | |
610 | - JSONParseInternal( |
611 | + JSONtoXMLInternal( |
612 | static_context* sctx, |
613 | const QueryLoc& loc, |
614 | std::vector<PlanIter_t>& children) |
615 | : |
616 | - NaryBaseIterator<JSONParseInternal, PlanIteratorState>(sctx, loc, children) |
617 | + NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>(sctx, loc, children) |
618 | {} |
619 | |
620 | - virtual ~JSONParseInternal(); |
621 | + virtual ~JSONtoXMLInternal(); |
622 | |
623 | void accept(PlanIterVisitor& v) const; |
624 | |
625 | @@ -71,25 +71,25 @@ |
626 | * |
627 | * Author: Zorba Team |
628 | */ |
629 | -class JSONSerializeInternal : public NaryBaseIterator<JSONSerializeInternal, PlanIteratorState> |
630 | +class XMLtoJSONInternal : public NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState> |
631 | { |
632 | public: |
633 | - SERIALIZABLE_CLASS(JSONSerializeInternal); |
634 | + SERIALIZABLE_CLASS(XMLtoJSONInternal); |
635 | |
636 | - SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONSerializeInternal, |
637 | - NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>); |
638 | + SERIALIZABLE_CLASS_CONSTRUCTOR2T(XMLtoJSONInternal, |
639 | + NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>); |
640 | |
641 | void serialize( ::zorba::serialization::Archiver& ar); |
642 | |
643 | - JSONSerializeInternal( |
644 | + XMLtoJSONInternal( |
645 | static_context* sctx, |
646 | const QueryLoc& loc, |
647 | std::vector<PlanIter_t>& children) |
648 | : |
649 | - NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>(sctx, loc, children) |
650 | + NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>(sctx, loc, children) |
651 | {} |
652 | |
653 | - virtual ~JSONSerializeInternal(); |
654 | + virtual ~XMLtoJSONInternal(); |
655 | |
656 | void accept(PlanIterVisitor& v) const; |
657 | |
658 | |
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 | TYPE_OptionIterator, |
664 | TYPE_FunctionAnnotationsIterator, |
665 | TYPE_MemSizeIterator, |
666 | - TYPE_JSONParseInternal, |
667 | - TYPE_JSONSerializeInternal, |
668 | + TYPE_JSONtoXMLInternal, |
669 | + TYPE_XMLtoJSONInternal, |
670 | TYPE_JSONDecodeFromRoundtripIterator, |
671 | TYPE_JSONEncodeForRoundtripIterator, |
672 | TYPE_JSONParseIterator, |
673 | |
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 | /******************************************************************************* |
679 | *******************************************************************************/ |
680 | --> |
681 | -<zorba:iterator name="JSONParseInternal" arity="nary"> |
682 | +<zorba:iterator name="JSONtoXMLInternal" arity="nary"> |
683 | |
684 | <zorba:description author="Zorba Team"> |
685 | function for parsing strings into json-xdm |
686 | </zorba:description> |
687 | |
688 | <zorba:function isDeterministic="true"> |
689 | - <zorba:signature localname="parse-internal" prefix="fn-zorba-json"> |
690 | + <zorba:signature localname="json-to-xml-internal" prefix="fn-zorba-json"> |
691 | <zorba:param>xs:string</zorba:param> |
692 | <zorba:param>item()?</zorba:param> |
693 | <zorba:output>element()*</zorba:output> |
694 | @@ -33,14 +33,14 @@ |
695 | /******************************************************************************* |
696 | *******************************************************************************/ |
697 | --> |
698 | -<zorba:iterator name="JSONSerializeInternal" arity="nary"> |
699 | +<zorba:iterator name="XMLtoJSONInternal" arity="nary"> |
700 | |
701 | <zorba:description author="Zorba Team"> |
702 | Function to serialize json/jsonml xdm to string |
703 | </zorba:description> |
704 | |
705 | <zorba:function isDeterministic="true"> |
706 | - <zorba:signature localname="serialize-internal" prefix="fn-zorba-json"> |
707 | + <zorba:signature localname="xml-to-json-internal" prefix="fn-zorba-json"> |
708 | <zorba:param>item()*</zorba:param> |
709 | <zorba:param>item()?</zorba:param> |
710 | <zorba:output>xs:string</zorba:output> |
711 | |
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 | define="ZORBA_URI_FN_NS" |
717 | prefix="fn-zorba-uri"/> |
718 | |
719 | - <zorba:namespace uri="http://www.zorba-xquery.com/modules/converters/json" |
720 | + <zorba:namespace uri="http://zorba.io/modules/json-xml" |
721 | define="ZORBA_JSON_FN_NS" |
722 | prefix="fn-zorba-json"/> |
723 | |
724 | |
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 | |
730 | class MemSizeIterator; |
731 | |
732 | - class JSONParseInternal; |
733 | + class JSONtoXMLInternal; |
734 | |
735 | - class JSONSerializeInternal; |
736 | + class XMLtoJSONInternal; |
737 | |
738 | class JSONDecodeFromRoundtripIterator; |
739 | |
740 | @@ -1207,11 +1207,11 @@ |
741 | virtual void beginVisit ( const MemSizeIterator& ) = 0; |
742 | virtual void endVisit ( const MemSizeIterator& ) = 0; |
743 | |
744 | - virtual void beginVisit ( const JSONParseInternal& ) = 0; |
745 | - virtual void endVisit ( const JSONParseInternal& ) = 0; |
746 | + virtual void beginVisit ( const JSONtoXMLInternal& ) = 0; |
747 | + virtual void endVisit ( const JSONtoXMLInternal& ) = 0; |
748 | |
749 | - virtual void beginVisit ( const JSONSerializeInternal& ) = 0; |
750 | - virtual void endVisit ( const JSONSerializeInternal& ) = 0; |
751 | + virtual void beginVisit ( const XMLtoJSONInternal& ) = 0; |
752 | + virtual void endVisit ( const XMLtoJSONInternal& ) = 0; |
753 | |
754 | virtual void beginVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; |
755 | virtual void endVisit ( const JSONDecodeFromRoundtripIterator& ) = 0; |
756 | |
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 | // </MemSizeIterator> |
762 | |
763 | |
764 | -// <JSONParseInternal> |
765 | -void PrinterVisitor::beginVisit ( const JSONParseInternal& a) { |
766 | - thePrinter.startBeginVisit("JSONParseInternal", ++theId); |
767 | - printCommons( &a, theId ); |
768 | - thePrinter.endBeginVisit( theId ); |
769 | -} |
770 | - |
771 | -void PrinterVisitor::endVisit ( const JSONParseInternal& ) { |
772 | - thePrinter.startEndVisit(); |
773 | - thePrinter.endEndVisit(); |
774 | -} |
775 | -// </JSONParseInternal> |
776 | - |
777 | - |
778 | -// <JSONSerializeInternal> |
779 | -void PrinterVisitor::beginVisit ( const JSONSerializeInternal& a) { |
780 | - thePrinter.startBeginVisit("JSONSerializeInternal", ++theId); |
781 | - printCommons( &a, theId ); |
782 | - thePrinter.endBeginVisit( theId ); |
783 | -} |
784 | - |
785 | -void PrinterVisitor::endVisit ( const JSONSerializeInternal& ) { |
786 | - thePrinter.startEndVisit(); |
787 | - thePrinter.endEndVisit(); |
788 | -} |
789 | -// </JSONSerializeInternal> |
790 | +// <JSONtoXMLInternal> |
791 | +void PrinterVisitor::beginVisit ( const JSONtoXMLInternal& a) { |
792 | + thePrinter.startBeginVisit("JSONtoXMLInternal", ++theId); |
793 | + printCommons( &a, theId ); |
794 | + thePrinter.endBeginVisit( theId ); |
795 | +} |
796 | + |
797 | +void PrinterVisitor::endVisit ( const JSONtoXMLInternal& ) { |
798 | + thePrinter.startEndVisit(); |
799 | + thePrinter.endEndVisit(); |
800 | +} |
801 | +// </JSONtoXMLInternal> |
802 | + |
803 | + |
804 | +// <XMLtoJSONInternal> |
805 | +void PrinterVisitor::beginVisit ( const XMLtoJSONInternal& a) { |
806 | + thePrinter.startBeginVisit("XMLtoJSONInternal", ++theId); |
807 | + printCommons( &a, theId ); |
808 | + thePrinter.endBeginVisit( theId ); |
809 | +} |
810 | + |
811 | +void PrinterVisitor::endVisit ( const XMLtoJSONInternal& ) { |
812 | + thePrinter.startEndVisit(); |
813 | + thePrinter.endEndVisit(); |
814 | +} |
815 | +// </XMLtoJSONInternal> |
816 | |
817 | |
818 | // <JSONDecodeFromRoundtripIterator> |
819 | |
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 | void beginVisit( const MemSizeIterator& ); |
825 | void endVisit ( const MemSizeIterator& ); |
826 | |
827 | - void beginVisit( const JSONParseInternal& ); |
828 | - void endVisit ( const JSONParseInternal& ); |
829 | + void beginVisit( const JSONtoXMLInternal& ); |
830 | + void endVisit ( const JSONtoXMLInternal& ); |
831 | |
832 | - void beginVisit( const JSONSerializeInternal& ); |
833 | - void endVisit ( const JSONSerializeInternal& ); |
834 | + void beginVisit( const XMLtoJSONInternal& ); |
835 | + void endVisit ( const XMLtoJSONInternal& ); |
836 | |
837 | void beginVisit( const JSONDecodeFromRoundtripIterator& ); |
838 | void endVisit ( const JSONDecodeFromRoundtripIterator& ); |
839 | |
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 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_04.jq 1067028) |
845 | EXPECTED_FAILURE(test/rbkt/zorba/jsoniq/comment_05.jq 1067028) |
846 | |
847 | +EXPECTED_FAILURE(test/rbkt/zorba/json/json-invalid-option-parameter 1200089) |
848 | |
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 | import module namespace file = "http://expath.org/ns/file"; |
854 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
855 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
856 | declare namespace zerr = "http://zorba.io/modules/zorba-errors"; |
857 | |
858 | let $file := "$RBKT_SRC_DIR/Queries/zorba/error/data-location.json" |
859 | let $json := file:read-text( $file ) |
860 | return |
861 | try { |
862 | - json:parse( $json ) |
863 | + jx:json-to-xml( $json ) |
864 | } |
865 | catch * { |
866 | file:base-name( $zerr:data-uri ), |
867 | |
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 | (: try parsing a valid JSON string with invalid JSON option parameter :) |
873 | |
874 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
875 | - |
876 | -let $options := |
877 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
878 | - <json-format value="array"/> |
879 | - </options> |
880 | - |
881 | -return json:parse('{}',$options) |
882 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
883 | + |
884 | +let $options := { "json-format" : "array" } |
885 | +return jx:json-to-xml('{}',$options) |
886 | |
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 @@ |
891 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
892 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
893 | |
894 | let $json := '[ "li", "list item" ]' |
895 | -let $options := |
896 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
897 | - <json-format value="JsonML-array"/> |
898 | - </options> |
899 | -return json:parse( $json, $options ) |
900 | +let $options := { "json-format" : "JsonML-array" } |
901 | +return jx:json-to-xml( $json, $options ) |
902 | |
903 | (: vim:set et sw=2 ts=2: :) |
904 | |
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 @@ |
909 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
910 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
911 | |
912 | let $json := ' |
913 | [ "ul", |
914 | @@ -6,10 +6,7 @@ |
915 | [ "li", "list item 2" ] |
916 | ] |
917 | ' |
918 | -let $options := |
919 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
920 | - <json-format value="JsonML-array"/> |
921 | - </options> |
922 | -return json:parse( $json, $options ) |
923 | +let $options := { "json-format" : "JsonML-array" } |
924 | +return jx:json-to-xml( $json, $options ) |
925 | |
926 | (: vim:set et sw=2 ts=2: :) |
927 | |
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 @@ |
932 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
933 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
934 | |
935 | let $json := ' |
936 | [ "file", |
937 | @@ -10,10 +10,7 @@ |
938 | } |
939 | ] |
940 | ' |
941 | -let $options := |
942 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
943 | - <json-format value="JsonML-array"/> |
944 | - </options> |
945 | -return json:parse( $json, $options ) |
946 | +let $options := { "json-format" : "JsonML-array" } |
947 | +return jx:json-to-xml( $json, $options ) |
948 | |
949 | (: vim:set et sw=2 ts=2: :) |
950 | |
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 @@ |
955 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
956 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
957 | |
958 | let $json := ' |
959 | [ "ul", |
960 | @@ -21,10 +21,7 @@ |
961 | " Item" |
962 | ] |
963 | ]' |
964 | -let $options := |
965 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
966 | - <json-format value="JsonML-array"/> |
967 | - </options> |
968 | -return json:parse( $json, $options ) |
969 | +let $options := { "json-format" : "JsonML-array" } |
970 | +return jx:json-to-xml( $json, $options ) |
971 | |
972 | (: vim:se et sw=2 ts=2: :) |
973 | |
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 @@ |
978 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
979 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
980 | |
981 | let $json := '["table", |
982 | { |
983 | @@ -59,10 +59,7 @@ |
984 | ] |
985 | ] |
986 | ]' |
987 | -let $options := |
988 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
989 | - <json-format value="JsonML-array"/> |
990 | - </options> |
991 | -return json:parse( $json, $options ) |
992 | +let $options := { "json-format" : "JsonML-array" } |
993 | +return jx:json-to-xml( $json, $options ) |
994 | |
995 | (: vim:se et sw=2 ts=2: :) |
996 | |
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 | (: try parsing an empty value :) |
1002 | |
1003 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1004 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1005 | |
1006 | -let $options := |
1007 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1008 | - <json-format value="JsonML-array"/> |
1009 | - </options> |
1010 | -return json:parse( <a/>, $options ) |
1011 | +let $options := { "json-format" : "JsonML-array" } |
1012 | +return jx:json-to-xml( <a/>, $options ) |
1013 | |
1014 | (: vim:set et sw=2 ts=2: :) |
1015 | |
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 @@ |
1020 | -import module namespace json = |
1021 | - "http://www.zorba-xquery.com/modules/converters/json"; |
1022 | +import module namespace jx = |
1023 | + "http://zorba.io/modules/json-xml"; |
1024 | |
1025 | -let $opt := |
1026 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1027 | - <json-format value="JsonML-array"/> |
1028 | - </options> |
1029 | +let $options := { "json-format" : "JsonML-array" } |
1030 | let $json := |
1031 | '{ |
1032 | "args": [ "<div><span>foo:</span> parse</div>" ] |
1033 | }' |
1034 | -return json:parse( $json, $opt ) |
1035 | +return jx:json-to-xml( $json, $options ) |
1036 | |
1037 | (: vim:set et sw=2 ts=2: :) |
1038 | |
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 @@ |
1043 | -import module namespace json = |
1044 | - "http://www.zorba-xquery.com/modules/converters/json"; |
1045 | +import module namespace jx = |
1046 | + "http://zorba.io/modules/json-xml"; |
1047 | |
1048 | -let $opt := |
1049 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1050 | - <json-format value="JsonML-array"/> |
1051 | - </options> |
1052 | +let $options := { "json-format" : "JsonML-array" } |
1053 | let $json := '[ { "x" : "x" } ]' |
1054 | -return json:parse( $json, $opt ) |
1055 | +return jx:json-to-xml( $json, $options ) |
1056 | |
1057 | (: vim:set et sw=2 ts=2: :) |
1058 | |
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 @@ |
1063 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1064 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1065 | |
1066 | let $json := ' |
1067 | [ "person", |
1068 | @@ -15,10 +15,7 @@ |
1069 | ] |
1070 | ] |
1071 | ' |
1072 | -let $options := |
1073 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1074 | - <json-format value="JsonML-array"/> |
1075 | - </options> |
1076 | -return json:parse( $json, $options ) |
1077 | +let $options := { "json-format" : "JsonML-array" } |
1078 | +return jx:json-to-xml( $json, $options ) |
1079 | |
1080 | (: vim:set et sw=2 ts=2: :) |
1081 | |
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 @@ |
1086 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1087 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1088 | |
1089 | let $json := |
1090 | <li>list item</li> |
1091 | -let $options := |
1092 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1093 | - <json-format value="JsonML-array"/> |
1094 | - </options> |
1095 | -return json:serialize( $json, $options ) |
1096 | +let $options := { "json-format" : "JsonML-array" } |
1097 | +return jx:xml-to-json( $json, $options ) |
1098 | |
1099 | (: vim:set et sw=2 ts=2: :) |
1100 | |
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 @@ |
1105 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1106 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1107 | |
1108 | let $json := |
1109 | <ul> |
1110 | <li>list item 1</li> |
1111 | <li>list item 2</li> |
1112 | </ul> |
1113 | -let $options := |
1114 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1115 | - <json-format value="JsonML-array"/> |
1116 | - </options> |
1117 | -return json:serialize( $json, $options ) |
1118 | +let $options := { "json-format" : "JsonML-array" } |
1119 | +return jx:xml-to-json( $json, $options ) |
1120 | |
1121 | (: vim:set et sw=2 ts=2: :) |
1122 | |
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 @@ |
1127 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1128 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1129 | |
1130 | let $json := |
1131 | <file dir="/tmp" name="foo" size="1234" modified="2006-12-31T23:59"/> |
1132 | -let $options := |
1133 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1134 | - <json-format value="JsonML-array"/> |
1135 | - </options> |
1136 | -return json:serialize( $json, $options ) |
1137 | +let $options := { "json-format" : "JsonML-array" } |
1138 | +return jx:xml-to-json( $json, $options ) |
1139 | |
1140 | (: vim:set et sw=2 ts=2: :) |
1141 | |
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 @@ |
1146 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1147 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1148 | |
1149 | let $json := |
1150 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1151 | @@ -11,11 +11,7 @@ |
1152 | <postalCode>98765-4321</postalCode> |
1153 | </address> |
1154 | </person> |
1155 | -let $options := |
1156 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1157 | - <json-format value="JsonML-array"/> |
1158 | - <whitespace value="indent"/> |
1159 | - </options> |
1160 | -return json:serialize( $json, $options ) |
1161 | +let $options := { "json-format" : "JsonML-array", "whitespace" : "indent" } |
1162 | +return jx:xml-to-json( $json, $options ) |
1163 | |
1164 | (: vim:set et sw=2 ts=2: :) |
1165 | |
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 @@ |
1170 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1171 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1172 | |
1173 | let $json := |
1174 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1175 | @@ -11,10 +11,7 @@ |
1176 | <postalCode>98765-4321</postalCode> |
1177 | </address> |
1178 | </person> |
1179 | -let $options := |
1180 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1181 | - <json-format value="JsonML-array"/> |
1182 | - </options> |
1183 | -return json:serialize( $json, $options ) |
1184 | +let $options := { "json-format" : "JsonML-array" } |
1185 | +return jx:xml-to-json( $json, $options ) |
1186 | |
1187 | (: vim:set et sw=2 ts=2: :) |
1188 | |
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 @@ |
1193 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1194 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1195 | |
1196 | let $json := |
1197 | <person created="2006-11-11T19:23" modified="2006-12-31T23:59"> |
1198 | @@ -11,11 +11,7 @@ |
1199 | <postalCode>98765-4321</postalCode> |
1200 | </address> |
1201 | </person> |
1202 | -let $options := |
1203 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1204 | - <json-format value="JsonML-array"/> |
1205 | - <whitespace value="some"/> |
1206 | - </options> |
1207 | -return json:serialize( $json, $options ) |
1208 | +let $options := { "json-format" : "JsonML-array", "whitespace" : "some" } |
1209 | +return jx:xml-to-json( $json, $options ) |
1210 | |
1211 | (: vim:set et sw=2 ts=2: :) |
1212 | |
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 @@ |
1217 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1218 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1219 | |
1220 | -json:parse('[ "ul", |
1221 | +jx:json-to-xml('[ "ul", |
1222 | [ "li", true], |
1223 | [ "li", |
1224 | {"href":"driving.html", "title":"Driving"}, |
1225 | |
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 @@ |
1230 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1231 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1232 | |
1233 | let $json := '[ true ]' |
1234 | -return json:parse( $json ) |
1235 | +return jx:json-to-xml( $json ) |
1236 | |
1237 | (: vim:set et sw=2 ts=2: :) |
1238 | |
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 @@ |
1243 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1244 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1245 | |
1246 | let $json := '[ false ]' |
1247 | -return json:parse( $json ) |
1248 | +return jx:json-to-xml( $json ) |
1249 | |
1250 | (: vim:set et sw=2 ts=2: :) |
1251 | |
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 @@ |
1256 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1257 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1258 | |
1259 | let $json := '[ null ]' |
1260 | -return json:parse( $json ) |
1261 | +return jx:json-to-xml( $json ) |
1262 | |
1263 | (: vim:set et sw=2 ts=2: :) |
1264 | |
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 @@ |
1269 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1270 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1271 | |
1272 | let $json := '[ 1 ]' |
1273 | -return json:parse( $json ) |
1274 | +return jx:json-to-xml( $json ) |
1275 | |
1276 | (: vim:set et sw=2 ts=2: :) |
1277 | |
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 @@ |
1282 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1283 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1284 | |
1285 | let $json := '[ 1, 2 ]' |
1286 | -return json:parse( $json ) |
1287 | +return jx:json-to-xml( $json ) |
1288 | |
1289 | (: vim:set et sw=2 ts=2: :) |
1290 | |
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 | (: parse a JSON array composed of 2 JSON objects :) |
1296 | |
1297 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1298 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1299 | |
1300 | -json:parse( '[ { "key1": "value1" }, { "key2": "value2" } ]' ) |
1301 | +jx:json-to-xml( '[ { "key1": "value1" }, { "key2": "value2" } ]' ) |
1302 | |
1303 | (: vim:set et sw=2 ts=2: :) |
1304 | |
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 | (: parse an JSON array composed of 2 JSON arrays :) |
1310 | |
1311 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1312 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1313 | |
1314 | -json:parse( '[ [ 11, 12 ], [ 21, 22 ] ]' ) |
1315 | +jx:json-to-xml( '[ [ 11, 12 ], [ 21, 22 ] ]' ) |
1316 | |
1317 | (: vim:se et sw=2 ts=2: :) |
1318 | |
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 @@ |
1323 | -import module namespace json = |
1324 | - "http://www.zorba-xquery.com/modules/converters/json"; |
1325 | +import module namespace jx = |
1326 | + "http://zorba.io/modules/json-xml"; |
1327 | |
1328 | let $json := '[ 1, { "foo": "bar" } ]' |
1329 | -return json:parse( $json ) |
1330 | +return jx:json-to-xml( $json ) |
1331 | |
1332 | (: vim:se et sw=2 ts=2: :) |
1333 | |
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 | (: try parsing an empty value :) |
1339 | |
1340 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1341 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1342 | |
1343 | -json:parse( <a/> ) |
1344 | +jx:json-to-xml( <a/> ) |
1345 | |
1346 | (: vim:se et sw=2 ts=2: :) |
1347 | |
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 @@ |
1352 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1353 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1354 | |
1355 | let $json := ' |
1356 | { |
1357 | @@ -16,6 +16,6 @@ |
1358 | ] |
1359 | } |
1360 | ' |
1361 | -return json:parse( $json ) |
1362 | +return jx:json-to-xml( $json ) |
1363 | |
1364 | (: vim:set et sw=2 ts=2: :) |
1365 | |
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 @@ |
1370 | -(: json:parse testing numbers :) |
1371 | - |
1372 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1373 | - |
1374 | -json:parse( '{ |
1375 | +(: jx:json-to-xml testing numbers :) |
1376 | + |
1377 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1378 | + |
1379 | +jx:json-to-xml( '{ |
1380 | "decimal": 2.89, |
1381 | "e": 2E+6, |
1382 | "negative": -1.89 |
1383 | |
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 @@ |
1388 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1389 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1390 | |
1391 | let $json := '{ "a" : 1 }' |
1392 | -return json:parse( $json ) |
1393 | +return jx:json-to-xml( $json ) |
1394 | |
1395 | (: vim:set et sw=2 ts=2: :) |
1396 | |
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 @@ |
1401 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1402 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1403 | |
1404 | let $json := '{ "a" : 1, "b" : 2 }' |
1405 | -return json:parse( $json ) |
1406 | +return jx:json-to-xml( $json ) |
1407 | |
1408 | (: vim:set et sw=2 ts=2: :) |
1409 | |
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 @@ |
1414 | -import module namespace json = |
1415 | - "http://www.zorba-xquery.com/modules/converters/json"; |
1416 | +import module namespace jx = |
1417 | + "http://zorba.io/modules/json-xml"; |
1418 | |
1419 | let $json := '{ "k1" : [ { "k2" : "v2" }, null ] }' |
1420 | -return json:parse( $json ) |
1421 | +return jx:json-to-xml( $json ) |
1422 | |
1423 | (: vim:se et sw=2 ts=2: :) |
1424 | |
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 @@ |
1429 | -import module namespace json = |
1430 | - "http://www.zorba-xquery.com/modules/converters/json"; |
1431 | +import module namespace jx = |
1432 | + "http://zorba.io/modules/json-xml"; |
1433 | |
1434 | let $json := ' |
1435 | { |
1436 | @@ -7,6 +7,6 @@ |
1437 | "key2": "value" |
1438 | } |
1439 | ' |
1440 | -return json:parse( $json ) |
1441 | +return jx:json-to-xml( $json ) |
1442 | |
1443 | (: vim:se et sw=2 ts=2: :) |
1444 | |
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 @@ |
1449 | -(: json:parse testing null as a key value :) |
1450 | - |
1451 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1452 | - |
1453 | -json:parse( '{ "a" : null }' ) |
1454 | +(: jx:json-to-xml testing null as a key value :) |
1455 | + |
1456 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1457 | + |
1458 | +jx:json-to-xml( '{ "a" : null }' ) |
1459 | |
1460 | (: vim:set et sw=2 ts=2: :) |
1461 | |
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 @@ |
1466 | -import module namespace json="http://www.zorba-xquery.com/modules/converters/json"; |
1467 | +import module namespace jx="http://zorba.io/modules/json-xml"; |
1468 | |
1469 | declare variable $json-element := |
1470 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1471 | <pair name="html" type="string"><b>bold</b></pair> |
1472 | </json>; |
1473 | |
1474 | -json:parse( json:serialize( $json-element ) ) |
1475 | +jx:json-to-xml( jx:xml-to-json( $json-element ) ) |
1476 | |
1477 | (: vim:se et sw=2 ts=2: :) |
1478 | |
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 @@ |
1483 | -(: json:parse with uncommon characters :) |
1484 | - |
1485 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1486 | - |
1487 | -json:parse( '{ "web-app" : "!_\"-\\?*.$+" }' ) |
1488 | +(: jx:json-to-xml with uncommon characters :) |
1489 | + |
1490 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1491 | + |
1492 | +jx:json-to-xml( '{ "web-app" : "!_\"-\\?*.$+" }' ) |
1493 | |
1494 | (: vim:se et sw=2 ts=2: :) |
1495 | |
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 | (: try parsing a Unicode UTF-8 value :) |
1501 | |
1502 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1503 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1504 | |
1505 | -json:parse( '{ "mdash": "–" }' ) |
1506 | +jx:json-to-xml( '{ "mdash": "–" }' ) |
1507 | |
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 @@ |
1512 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1513 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1514 | |
1515 | let $json := |
1516 | <json type="array"> |
1517 | <item type="boolean">true</item> |
1518 | </json> |
1519 | -return json:serialize( $json ) |
1520 | +return jx:xml-to-json( $json ) |
1521 | |
1522 | (: vim:set et sw=2 ts=2: :) |
1523 | |
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 @@ |
1528 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1529 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1530 | |
1531 | let $json := |
1532 | <json type="array"> |
1533 | <item type="boolean">false</item> |
1534 | </json> |
1535 | -return json:serialize( $json ) |
1536 | +return jx:xml-to-json( $json ) |
1537 | |
1538 | (: vim:set et sw=2 ts=2: :) |
1539 | |
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 @@ |
1544 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1545 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1546 | |
1547 | let $json := |
1548 | <json type="array"> |
1549 | <item type="null"/> |
1550 | </json> |
1551 | -return json:serialize( $json ) |
1552 | +return jx:xml-to-json( $json ) |
1553 | |
1554 | (: vim:set et sw=2 ts=2: :) |
1555 | |
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 @@ |
1560 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1561 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1562 | |
1563 | let $json := |
1564 | <json type="array"> |
1565 | <item type="number">1</item> |
1566 | </json> |
1567 | -return json:serialize( $json ) |
1568 | +return jx:xml-to-json( $json ) |
1569 | |
1570 | (: vim:set et sw=2 ts=2: :) |
1571 | |
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 @@ |
1576 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1577 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1578 | |
1579 | let $json := |
1580 | <json type="array"> |
1581 | <item type="number">1</item> |
1582 | <item type="number">2</item> |
1583 | </json> |
1584 | -return json:serialize( $json ) |
1585 | +return jx:xml-to-json( $json ) |
1586 | |
1587 | (: vim:set et sw=2 ts=2: :) |
1588 | |
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 @@ |
1593 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1594 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1595 | |
1596 | let $json := |
1597 | <json type="array"> |
1598 | <foo type="boolean">true</foo> |
1599 | </json> |
1600 | -return json:serialize( $json ) |
1601 | +return jx:xml-to-json( $json ) |
1602 | |
1603 | (: vim:set et sw=2 ts=2: :) |
1604 | |
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 @@ |
1609 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1610 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1611 | |
1612 | let $json := |
1613 | <json type="array"> |
1614 | <item type="boolean">foo</item> |
1615 | </json> |
1616 | -return json:serialize( $json ) |
1617 | +return jx:xml-to-json( $json ) |
1618 | |
1619 | (: vim:set et sw=2 ts=2: :) |
1620 | |
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 @@ |
1625 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1626 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1627 | |
1628 | let $json := |
1629 | <json type="array"> |
1630 | <item>false</item> |
1631 | </json> |
1632 | -return json:serialize( $json ) |
1633 | +return jx:xml-to-json( $json ) |
1634 | |
1635 | (: vim:set et sw=2 ts=2: :) |
1636 | |
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 @@ |
1641 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1642 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1643 | |
1644 | let $json := |
1645 | <json type="array"> |
1646 | <item type="bool">false</item> |
1647 | </json> |
1648 | -return json:serialize( $json ) |
1649 | +return jx:xml-to-json( $json ) |
1650 | |
1651 | (: vim:set et sw=2 ts=2: :) |
1652 | |
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 @@ |
1657 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1658 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1659 | |
1660 | let $json := |
1661 | <json type="array"> |
1662 | hello |
1663 | </json> |
1664 | -return json:serialize( $json ) |
1665 | +return jx:xml-to-json( $json ) |
1666 | |
1667 | (: vim:set et sw=2 ts=2: :) |
1668 | |
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 @@ |
1673 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1674 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1675 | |
1676 | let $json := |
1677 | <json type="array"> |
1678 | <item type="boolean"><foo/></item> |
1679 | </json> |
1680 | -return json:serialize( $json ) |
1681 | +return jx:xml-to-json( $json ) |
1682 | |
1683 | (: vim:set et sw=2 ts=2: :) |
1684 | |
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 | (: valid json generation: comments should be ignored :) |
1690 | |
1691 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1692 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1693 | |
1694 | let $json := |
1695 | <json type="array"> |
1696 | <!--comment--> |
1697 | <item type="boolean">true</item> |
1698 | </json> |
1699 | -return json:serialize( $json ) |
1700 | +return jx:xml-to-json( $json ) |
1701 | |
1702 | (: vim:set et sw=2 ts=2: :) |
1703 | |
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 @@ |
1708 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1709 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1710 | |
1711 | let $json := <!--comment--> |
1712 | -return json:serialize( $json ) |
1713 | +return jx:xml-to-json( $json ) |
1714 | |
1715 | (: vim:set et sw=2 ts=2: :) |
1716 | |
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 @@ |
1721 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1722 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1723 | |
1724 | let $json := |
1725 | <json type="object"> |
1726 | @@ -15,11 +15,7 @@ |
1727 | <item type="string">646 123-4567</item> |
1728 | </pair> |
1729 | </json> |
1730 | -let $options := |
1731 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1732 | - <json-format value="Snelson"/> |
1733 | - <whitespace value="indent"/> |
1734 | - </options> |
1735 | -return json:serialize( $json, $options ) |
1736 | +let $options := { "json-format" : "Snelson", "whitespace" : "indent" } |
1737 | +return jx:xml-to-json( $json, $options ) |
1738 | |
1739 | (: vim:set et sw=2 ts=2: :) |
1740 | |
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 @@ |
1745 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1746 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1747 | |
1748 | let $json := |
1749 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1750 | <pair name="a" type="nothing">a</pair> |
1751 | </json> |
1752 | -return json:serialize( $json ) |
1753 | +return jx:xml-to-json( $json ) |
1754 | |
1755 | (: vim:set et sw=2 ts=2: :) |
1756 | |
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 @@ |
1761 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1762 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1763 | |
1764 | let $json := |
1765 | <json type="object"> |
1766 | @@ -15,6 +15,6 @@ |
1767 | <item type="string">646 123-4567</item> |
1768 | </pair> |
1769 | </json> |
1770 | -return json:serialize( $json ) |
1771 | +return jx:xml-to-json( $json ) |
1772 | |
1773 | (: vim:set et sw=2 ts=2: :) |
1774 | |
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 @@ |
1779 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1780 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1781 | |
1782 | let $json := |
1783 | <json type="object"> |
1784 | <pair name="a" type="number">1</pair> |
1785 | </json> |
1786 | -return json:serialize( $json ) |
1787 | +return jx:xml-to-json( $json ) |
1788 | |
1789 | (: vim:set et sw=2 ts=2: :) |
1790 | |
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 @@ |
1795 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1796 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1797 | |
1798 | let $json := |
1799 | <json type="object"> |
1800 | <pair name="a" type="number">1</pair> |
1801 | <pair name="b" type="number">2</pair> |
1802 | </json> |
1803 | -return json:serialize( $json ) |
1804 | +return jx:xml-to-json( $json ) |
1805 | |
1806 | (: vim:set et sw=2 ts=2: :) |
1807 | |
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 | (: valid json generation: comments should be ignored :) |
1813 | |
1814 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1815 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1816 | |
1817 | let $json := |
1818 | <json type="object"> |
1819 | @@ -8,6 +8,6 @@ |
1820 | <pair name="a" type="number">1</pair> |
1821 | <!--comment--> |
1822 | </json> |
1823 | -return json:serialize( $json ) |
1824 | +return jx:xml-to-json( $json ) |
1825 | |
1826 | (: vim:set et sw=2 ts=2: :) |
1827 | |
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 @@ |
1832 | -import module namespace json="http://www.zorba-xquery.com/modules/converters/json"; |
1833 | +import module namespace jx="http://zorba.io/modules/json-xml"; |
1834 | |
1835 | declare variable $json-value := '{ "key" : "value" }'; |
1836 | |
1837 | -json:serialize( json:parse( $json-value ) ) |
1838 | +jx:xml-to-json( jx:json-to-xml( $json-value ) ) |
1839 | |
1840 | (: vim:se et sw=2 ts=2: :) |
1841 | |
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 @@ |
1846 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1847 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1848 | |
1849 | let $json := |
1850 | <json type="object"> |
1851 | @@ -15,11 +15,7 @@ |
1852 | <item type="string">646 123-4567</item> |
1853 | </pair> |
1854 | </json> |
1855 | -let $options := |
1856 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> |
1857 | - <json-format value="Snelson"/> |
1858 | - <whitespace value="some"/> |
1859 | - </options> |
1860 | -return json:serialize( $json, $options ) |
1861 | +let $options := { "json-format" : "Snelson", "whitespace" : "some" } |
1862 | +return jx:xml-to-json( $json, $options ) |
1863 | |
1864 | (: vim:set et sw=2 ts=2: :) |
1865 | |
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 @@ |
1870 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
1871 | +import module namespace jx = "http://zorba.io/modules/json-xml"; |
1872 | |
1873 | let $json := |
1874 | <json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="object"> |
1875 | <pair name="a">a</pair> |
1876 | </json> |
1877 | -return json:serialize( $json ) |
1878 | +return jx:xml-to-json( $json ) |
1879 | |
1880 | (: vim:set et sw=2 ts=2: :) |
1881 | |
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 | import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents"; |
1887 | |
1888 | -import module namespace j = "http://www.zorba-xquery.com/modules/converters/json"; |
1889 | +import module namespace j = "http://zorba.io/modules/json-xml"; |
1890 | |
1891 | -j:serialize( |
1892 | +j:xml-to-json( |
1893 | doc:document("meat_poultry.xml")/root/row, |
1894 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
1895 | - <json-format value="JsonML-array" /> |
1896 | - </options> |
1897 | + { "json-format" : "JsonML-array" } |
1898 | ) |
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