Merge lp:~zorba-coders/zorba/remove_old_json into lp:~zorba-coders/zorba/data-converters-module
- remove_old_json
- Merge into data-converters-module
Status: | Merged |
---|---|
Approved by: | Chris Hillery |
Approved revision: | 80 |
Merged at revision: | 80 |
Proposed branch: | lp:~zorba-coders/zorba/remove_old_json |
Merge into: | lp:~zorba-coders/zorba/data-converters-module |
Diff against target: |
3082 lines (+0/-2529) 98 files modified
cmake_modules/FindJansson.cmake (+0/-64) src/com/zorba-xquery/www/modules/converters/CMakeLists.txt (+0/-35) src/com/zorba-xquery/www/modules/converters/json-options.xsd (+0/-47) src/com/zorba-xquery/www/modules/converters/json.xq (+0/-242) src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp (+0/-729) src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h (+0/-56) src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp (+0/-317) src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h (+0/-167) src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp (+0/-153) src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h (+0/-49) test_json/ExpQueryResults/converters/jansson/parse_json_01.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_02.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_03.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_06.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_07.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_08.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_09.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_10.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_11.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_12.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_ml_01.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_ml_02.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_ml_05.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/parse_json_ml_06.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_10.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_17.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_18.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_ml_01.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_ml_02.xml.res (+0/-1) test_json/ExpQueryResults/converters/jansson/serialize_json_ml_04.xml.res (+0/-1) test_json/Queries/converters/jansson/parse_json_01.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_01.xq (+0/-22) test_json/Queries/converters/jansson/parse_json_02.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_02.xq (+0/-37) test_json/Queries/converters/jansson/parse_json_03.xq (+0/-8) test_json/Queries/converters/jansson/parse_json_04.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_04.xq (+0/-8) test_json/Queries/converters/jansson/parse_json_05.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_05.xq (+0/-14) test_json/Queries/converters/jansson/parse_json_06.xq (+0/-8) test_json/Queries/converters/jansson/parse_json_07.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_07.xq (+0/-13) test_json/Queries/converters/jansson/parse_json_08.xq (+0/-8) test_json/Queries/converters/jansson/parse_json_09.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_09.xq (+0/-26) test_json/Queries/converters/jansson/parse_json_10.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_10.xq (+0/-40) test_json/Queries/converters/jansson/parse_json_11.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_11.xq (+0/-20) test_json/Queries/converters/jansson/parse_json_12.xq (+0/-4) test_json/Queries/converters/jansson/parse_json_ml_01.xq (+0/-27) test_json/Queries/converters/jansson/parse_json_ml_02.xq (+0/-65) test_json/Queries/converters/jansson/parse_json_ml_03.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_ml_03.xq (+0/-8) test_json/Queries/converters/jansson/parse_json_ml_04.spec (+0/-1) test_json/Queries/converters/jansson/parse_json_ml_04.xq (+0/-16) test_json/Queries/converters/jansson/parse_json_ml_05.xq (+0/-24) test_json/Queries/converters/jansson/parse_json_ml_06.xq (+0/-7) test_json/Queries/converters/jansson/serialize_json_01.xq (+0/-9) test_json/Queries/converters/jansson/serialize_json_02.xq (+0/-8) test_json/Queries/converters/jansson/serialize_json_03.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_03.xq (+0/-8) test_json/Queries/converters/jansson/serialize_json_04.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_05.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_06.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_06.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_07.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_07.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_08.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_08.xq (+0/-12) test_json/Queries/converters/jansson/serialize_json_09.xq (+0/-15) test_json/Queries/converters/jansson/serialize_json_10.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_10.xq (+0/-15) test_json/Queries/converters/jansson/serialize_json_11.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_11.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_12.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_12.xq (+0/-10) test_json/Queries/converters/jansson/serialize_json_13.xq (+0/-16) test_json/Queries/converters/jansson/serialize_json_14.xq (+0/-16) test_json/Queries/converters/jansson/serialize_json_15.xq (+0/-13) test_json/Queries/converters/jansson/serialize_json_16.xq (+0/-14) test_json/Queries/converters/jansson/serialize_json_17.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_17.xq (+0/-23) test_json/Queries/converters/jansson/serialize_json_18.xq (+0/-7) test_json/Queries/converters/jansson/serialize_json_ml_01.xq (+0/-12) test_json/Queries/converters/jansson/serialize_json_ml_02.xq (+0/-21) test_json/Queries/converters/jansson/serialize_json_ml_03.spec (+0/-1) test_json/Queries/converters/jansson/serialize_json_ml_03.xq (+0/-8) test_json/Queries/converters/jansson/serialize_json_ml_04.xq (+0/-10) |
To merge this branch: | bzr merge lp:~zorba-coders/zorba/remove_old_json |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthias Brantner | Approve | ||
Paul J. Lucas | Approve | ||
Review via email: mp+89770@code.launchpad.net |
Commit message
Removed old JSON module.
Description of the change
Removed old JSON module.
Paul J. Lucas (paul-lucas) : | # |
Matthias Brantner (matthias-brantner) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
The attempt to merge lp:~zorba-coders/zorba/remove_old_json into lp:zorba/data-converters-module failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job remove_
The final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job remove_
All tests succeeded!
Preview Diff
1 | === removed file 'cmake_modules/FindJansson.cmake' |
2 | --- cmake_modules/FindJansson.cmake 2011-10-06 07:40:17 +0000 |
3 | +++ cmake_modules/FindJansson.cmake 1970-01-01 00:00:00 +0000 |
4 | @@ -1,64 +0,0 @@ |
5 | -# Copyright 2006-2008 The FLWOR Foundation. |
6 | -# |
7 | -# Licensed under the Apache License, Version 2.0 (the "License"); |
8 | -# you may not use this file except in compliance with the License. |
9 | -# You may obtain a copy of the License at |
10 | -# |
11 | -# http://www.apache.org/licenses/LICENSE-2.0 |
12 | -# |
13 | -# Unless required by applicable law or agreed to in writing, software |
14 | -# distributed under the License is distributed on an "AS IS" BASIS, |
15 | -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
16 | -# See the License for the specific language governing permissions and |
17 | -# limitations under the License. |
18 | -# |
19 | -# - Find Jansson |
20 | -# |
21 | -# Once done this will define |
22 | -# |
23 | -# Jansson_FOUND - System has Jansson |
24 | -# Jansson_INCLUDE_DIRS - The Jansson include directories |
25 | -# Jansson_LIBRARIES - The libraries needed to use Jansson |
26 | - |
27 | -IF (Jansson_INCLUDE AND Jansson_LIBRARY) |
28 | - # in cache already |
29 | - SET(Jansson_FIND_QUIETLY TRUE) |
30 | -ENDIF (Jansson_INCLUDE AND Jansson_LIBRARY) |
31 | - |
32 | -SET(LIBRARY_NAMES jansson jansson.lib Release/jansson.lib bin/jansson.lib bin/Release/jansson.lib) |
33 | -FIND_LIBRARY( |
34 | - Jansson_LIBRARY |
35 | - NAMES ${LIBRARY_NAMES} |
36 | - PATHS /usr/lib /usr/local/lib /opt/local/lib ${Jansson_LIBRARIES}) |
37 | - |
38 | -FIND_PATH( |
39 | - Jansson_INCLUDE |
40 | - NAMES jansson.h |
41 | - PATH_SUFFIXES jansson src |
42 | - PATHS ${Jansson_INCLUDE_DIRS}) |
43 | - |
44 | -IF(Jansson_LIBRARY AND Jansson_INCLUDE) |
45 | - SET(Jansson_FOUND TRUE) |
46 | - SET(Jansson_LIBRARIES ${Jansson_LIBRARY}) |
47 | - SET(Jansson_INCLUDE_DIRS ${Jansson_INCLUDE}) |
48 | -ELSE(Jansson_LIBRARY AND Jansson_INCLUDE) |
49 | - IF(NOT Jansson_LIBRARY) |
50 | - MESSAGE(STATUS "Jansson static library could not be found matching one of: ${LIBRARY_NAMES}") |
51 | - ENDIF(NOT Jansson_LIBRARY) |
52 | - IF(NOT Jansson_INCLUDE) |
53 | - MESSAGE(STATUS "Jansson source directory could not be found.") |
54 | - ENDIF(NOT Jansson_INCLUDE) |
55 | - |
56 | - SET(Jansson_FOUND FALSE) |
57 | - SET(Jansson_LIBRARIES) |
58 | - SET(Jansson_INCLUDE) |
59 | -ENDIF (Jansson_LIBRARY AND Jansson_INCLUDE) |
60 | - |
61 | -IF(Jansson_FOUND) |
62 | - IF(NOT Jansson_FIND_QUIETLY) |
63 | - MESSAGE(STATUS "Found Jansson : ${Jansson_LIBRARY}") |
64 | - MESSAGE(STATUS "Found Jansson include path : ${Jansson_INCLUDE_DIRS}") |
65 | - ENDIF(NOT Jansson_FIND_QUIETLY) |
66 | -ELSE(Jansson_FOUND) |
67 | - MESSAGE(STATUS "Could not find Jansson library.") |
68 | -ENDIF(Jansson_FOUND) |
69 | |
70 | === modified file 'src/com/zorba-xquery/www/modules/converters/CMakeLists.txt' |
71 | --- src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 2011-12-06 08:05:27 +0000 |
72 | +++ src/com/zorba-xquery/www/modules/converters/CMakeLists.txt 2012-01-23 19:42:25 +0000 |
73 | @@ -40,40 +40,6 @@ |
74 | ENDIF (ZORBA_SUPPRESS_LIBTIDY) |
75 | MESSAGE (STATUS "") |
76 | |
77 | - |
78 | -# |
79 | -# Jansson |
80 | -# |
81 | -IF (ZORBA_SUPPRESS_JANSSON) |
82 | - MESSAGE (STATUS "ZORBA_SUPPRESS_JANSSON is true - not searching for Jansson.") |
83 | -ELSE (ZORBA_SUPPRESS_JANSSON) |
84 | - |
85 | - MESSAGE (STATUS "Looking for Jansson") |
86 | - FIND_PACKAGE (Jansson) |
87 | - |
88 | - IF (Jansson_FOUND) |
89 | - MESSAGE (STATUS "Found Jansson library -- " ${Jansson_LIBRARIES}) |
90 | - |
91 | - SET (JSON_LINK_LIBRARIES ${Jansson_LIBRARIES}) |
92 | - INCLUDE_DIRECTORIES (${Jansson_INCLUDE_DIRS}) |
93 | - INCLUDE_DIRECTORIES ("json.xq.src") |
94 | - DECLARE_ZORBA_SCHEMA (FILE "json-options.xsd" |
95 | - URI "http://www.zorba-xquery.com/modules/converters/json-options") |
96 | - DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/converters/json" VERSION 1.0 FILE "json.xq" LINK_LIBRARIES "${Jansson_LIBRARIES}") |
97 | - ADD_TEST_DIRECTORY ("${PROJECT_SOURCE_DIR}/test_json") |
98 | - |
99 | - IF(ZORBA_NO_UNICODE) |
100 | - SET_TESTS_PROPERTIES(zorba_data-converters_module/converters/jansson/parse_json_03.xq |
101 | - PROPERTIES WILL_FAIL TRUE) |
102 | - ENDIF(ZORBA_NO_UNICODE) |
103 | - |
104 | - ELSE (Jansson_FOUND) |
105 | - MESSAGE (STATUS "Jansson library not found -- if you want to use Json functionality please set Jansson_INCLUDE_DIRS and Jansson_LIBRARIES cmake parameters.") |
106 | - ENDIF (Jansson_FOUND) |
107 | -ENDIF (ZORBA_SUPPRESS_JANSSON) |
108 | -MESSAGE (STATUS "") |
109 | - |
110 | - |
111 | # csv |
112 | DECLARE_ZORBA_SCHEMA (FILE csv-options.xsd |
113 | URI "http://www.zorba-xquery.com/modules/converters/csv-options") |
114 | @@ -97,4 +63,3 @@ |
115 | SET_TESTS_PROPERTIES(zorba_data-converters_module/converters/csv/csv_parse_utf8_11.xq |
116 | PROPERTIES WILL_FAIL TRUE) |
117 | ENDIF(ZORBA_NO_UNICODE) |
118 | - |
119 | |
120 | === removed file 'src/com/zorba-xquery/www/modules/converters/json-options.xsd' |
121 | --- src/com/zorba-xquery/www/modules/converters/json-options.xsd 2011-08-11 20:09:07 +0000 |
122 | +++ src/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000 |
123 | @@ -1,47 +0,0 @@ |
124 | -<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" |
125 | - xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options" |
126 | - targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options" |
127 | - elementFormDefault="qualified" attributeFormDefault="unqualified"> |
128 | -<!-- |
129 | -:: Copyright 2006-2008 The FLWOR Foundation. |
130 | -:: |
131 | -:: Licensed under the Apache License, Version 2.0 (the "License"); |
132 | -:: you may not use this file except in compliance with the License. |
133 | -:: You may obtain a copy of the License at |
134 | -:: |
135 | -:: http://www.apache.org/licenses/LICENSE-2.0 |
136 | -:: |
137 | -:: Unless required by applicable law or agreed to in writing, software |
138 | -:: distributed under the License is distributed on an "AS IS" BASIS, |
139 | -:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
140 | -:: See the License for the specific language governing permissions and |
141 | -:: limitations under the License. |
142 | -:: |
143 | ---> |
144 | - |
145 | - |
146 | - <xs:element name="options"> |
147 | - <xs:complexType> |
148 | - <xs:sequence> |
149 | - <xs:element name="json-param" minOccurs="1" maxOccurs="1"> |
150 | - <xs:complexType> |
151 | - <xs:simpleContent> |
152 | - <xs:extension base="xs:string"> |
153 | - <xs:attribute name="name" type="xs:string" use="required"/> |
154 | - <xs:attribute name="value" use="required"> |
155 | - <xs:simpleType> |
156 | - <xs:restriction base="xs:string"> |
157 | - <xs:enumeration value="simple-json"/> |
158 | - <xs:enumeration value="json-ml"/> |
159 | - </xs:restriction> |
160 | - </xs:simpleType> |
161 | - </xs:attribute> |
162 | - <xs:attribute name="type" type="xs:string" use="optional"/> |
163 | - </xs:extension> |
164 | - </xs:simpleContent> |
165 | - </xs:complexType> |
166 | - </xs:element> |
167 | - </xs:sequence> |
168 | - </xs:complexType> |
169 | - </xs:element> |
170 | -</xs:schema> |
171 | |
172 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq' |
173 | --- src/com/zorba-xquery/www/modules/converters/json.xq 2012-01-09 21:58:00 +0000 |
174 | +++ src/com/zorba-xquery/www/modules/converters/json.xq 1970-01-01 00:00:00 +0000 |
175 | @@ -1,242 +0,0 @@ |
176 | -xquery version "3.0"; |
177 | - |
178 | - (: |
179 | - : Copyright 2006-2009 The FLWOR Foundation. |
180 | - : |
181 | - : Licensed under the Apache License, Version 2.0 (the "License"); |
182 | - : you may not use this file except in compliance with the License. |
183 | - : You may obtain a copy of the License at |
184 | - : |
185 | - : http://www.apache.org/licenses/LICENSE-2.0 |
186 | - : |
187 | - : Unless required by applicable law or agreed to in writing, software |
188 | - : distributed under the License is distributed on an "AS IS" BASIS, |
189 | - : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
190 | - : See the License for the specific language governing permissions and |
191 | - : limitations under the License. |
192 | - :) |
193 | - |
194 | - (:~ |
195 | - : |
196 | - : <p>In order to enable JSON processing with XQuery, Zorba implements a set |
197 | - : of functions that open XQuery developers the door to process JSON |
198 | - : data. Specifically, this module provides two types of functions. Functions |
199 | - : to: |
200 | - : <ul> |
201 | - : <li>parse JSON and convert it to XDM and</li> |
202 | - : <li>serialize XDM in order to output JSON.</li> |
203 | - : </ul> |
204 | - : </p> |
205 | - : |
206 | - : <p>Both types of functions are available to parse and serialize two |
207 | - : types of XDM-JSON mappings:<ul><li>the first mapping called in this document |
208 | - : <strong>simple XDM-JSON</strong> has been |
209 | - : <a href="http://john.snelson.org.uk/parsing-json-into-xquery"> |
210 | - : proposed by John Snelson</a></li><li>the second mapping is called |
211 | - : <a href="http://jsonml.org/">JsonML</a></li></ul>In the following, we |
212 | - : briefly describe both mappings.</p> |
213 | - : |
214 | - : <h2>Simple XDM-JSON Mapping</h2> |
215 | - : <ul><li>In order to process JSON with XQuery, Zorba implements a mapping between |
216 | - : JSON and XML that was initially proposed by John Snelson in his article |
217 | - : <a href="http://john.snelson.org.uk/parsing-json-into-xquery" |
218 | - : target="_blank">Parsing JSON into XQuery</a></li></ul> |
219 | - : |
220 | - : <h2>JsonML Mapping</h2> |
221 | - : <ul> |
222 | - : <li><a href="http://jsonml.org" target="_blank">JSonML</a> (JSON Markup Language) |
223 | - : is an application of the JSON format.</li> |
224 | - : <li>The purpose of JSonML is to provide a compact format for transporting |
225 | - : XML-based markup as JSon. In contrast to the <strong>simple XDM-JSON</strong> mapping described above |
226 | - : <strong>JsonML</strong> allows a lossless conversion back and forth.</li></ul> |
227 | - : |
228 | - : <h2>Important Notes:</h2> |
229 | - : <ul><li>Zorba uses the <a href="http://www.digip.org/jansson/">Jansson library</a> |
230 | - : for manipulating JSON data.</li> |
231 | - : <li>We have tested against the following Jansson library versions: |
232 | - : <ul><li><a href="http://www.digip.org/jansson/doc/1.2/">Jansson 1.2.1</a></li> |
233 | - : <li><a href="http://www.digip.org/jansson/doc/1.3/">Jansson 1.3</a></li> |
234 | - : <li><a href="http://www.digip.org/jansson/doc/2.0/">Jansson 2.0</a></li></ul> available from |
235 | - : <a href="http://www.digip.org/jansson/releases/">Jansson releases</a>.</li></ul> |
236 | - : |
237 | - : @author Sorin Nasoi |
238 | - : @library <a href="http://www.digip.org/jansson/">Jansson library for encoding, decoding and manipulating JSON data</a> |
239 | - : |
240 | - : @see <a href="http://john.snelson.org.uk/parsing-json-into-xquery">Mapping proposed by John Snelson</a> |
241 | - : @see <a href="http://jsonml.org" target="_blank">JSonML</a> |
242 | - : @see <a href="http://www.digip.org/jansson/doc/2.0/">Jansson library for encoding, decoding and manipulating JSON data</a> |
243 | - : @project data processing/data converters |
244 | - : |
245 | - :) |
246 | -module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
247 | - |
248 | -import module namespace schema = "http://www.zorba-xquery.com/modules/schema"; |
249 | - |
250 | -import schema namespace json-options = "http://www.zorba-xquery.com/modules/converters/json-options"; |
251 | - |
252 | -declare namespace err = "http://www.w3.org/2005/xqt-errors"; |
253 | - |
254 | -declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; |
255 | -declare option ver:module-version "1.0"; |
256 | - |
257 | -(:~ |
258 | - : This function parses a JSON string and returns an XDM instance according |
259 | - : to either one of the mappings described above. |
260 | - : |
261 | - : @param $arg a sequence of valid JSON strings. |
262 | - : @param $options a set of name and value pairs that provide options |
263 | - : to configure the JSON mapping process that have to be validated against the |
264 | - : "http://www.zorba-xquery.com/modules/converters/json-options" schema. |
265 | - : @return a sequence of nodes according to either one of the mappings described above. |
266 | - : @error err:XQDY0027 if $options can not be validated against the json-options schema |
267 | - : @error json:ParseError if the JSON string passed as parameter is not |
268 | - : valid JSON. |
269 | - : @example test_json/Queries/converters/jansson/parse_json_02.xq |
270 | - : @example test_json/Queries/converters/jansson/parse_json_ml_01.xq |
271 | - :) |
272 | -declare function json:parse( |
273 | - $arg as xs:string?, |
274 | - $options as element(json-options:options) |
275 | -) as document-node(element(*, xs:untyped)) |
276 | -{ |
277 | - let $validated-options := if(schema:is-validated($options)) then |
278 | - $options |
279 | - else |
280 | - validate{$options} |
281 | - return |
282 | - json:parse-internal($arg, $validated-options) |
283 | -}; |
284 | - |
285 | -(:~ |
286 | - : This function parses a JSON string and returns an XDM instance according |
287 | - : to simple XDM-JSON mapping described above. |
288 | - : |
289 | - : @param $arg a sequence of valid JSON strings. |
290 | - : @return a sequence of nodes according to Simple XDM-JSON mapping described above. |
291 | - : @error json:ParseError if the JSON string passed as parameter is not |
292 | - : valid JSON. |
293 | - : @example test_json/Queries/converters/jansson/parse_json_11.xq |
294 | - :) |
295 | -declare function json:parse( |
296 | - $arg as xs:string? |
297 | -) as document-node(element(*, xs:untyped)) |
298 | -{ |
299 | - json:parse-internal($arg, |
300 | - validate { |
301 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
302 | - <json-param name="mapping" value="simple-json" /> |
303 | - </options> |
304 | - } |
305 | - ) |
306 | -}; |
307 | - |
308 | -(:~ |
309 | - : This function parses a JSON string and returns an XDM instance according |
310 | - : to JsonML mapping described above. |
311 | - : |
312 | - : @param $arg a sequence of valid JSON strings. |
313 | - : @return a sequence of nodes according the JSON-ML mapping described above. |
314 | - : @error json:ParseError if the JSON string passed as parameter is not |
315 | - : valid JSON. |
316 | - : @example test_json/Queries/converters/jansson/parse_json_ml_05.xq |
317 | - :) |
318 | -declare function json:parse-ml( |
319 | - $arg as xs:string? |
320 | -) as document-node(element(*, xs:untyped)) |
321 | -{ |
322 | - json:parse-internal($arg, |
323 | - validate { |
324 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
325 | - <json-param name="mapping" value="json-ml" type="array"/> |
326 | - </options> |
327 | - } |
328 | - ) |
329 | -}; |
330 | - |
331 | -declare %private function json:parse-internal( |
332 | - $html as xs:string, |
333 | - $options as element(json-options:options)? |
334 | -) as document-node(element(*, xs:untyped)) external; |
335 | - |
336 | - |
337 | -(:~ |
338 | - : The serialize function takes a sequence of nodes as parameter and |
339 | - : transforms each element into a valid JSON string according to one of the |
340 | - : mappings described above. |
341 | - : |
342 | - : @param $xml a sequence of nodes. |
343 | - : @param $options a set of name and value pairs that provide options |
344 | - : to configure the JSON mapping process that have to be validated against the |
345 | - : "http://www.zorba-xquery.com/modules/converters/json-options" schema. |
346 | - : @return a JSON string. |
347 | - : @error err:XQDY0027 if $options can not be validated against the json-options schema |
348 | - : @error json:InvalidXDM if the input $xml is not a valid XDM |
349 | - : representation of JSON or JSON ML. |
350 | - : @example test_json/Queries/converters/jansson/serialize_json_01.xq |
351 | - : @example test_json/Queries/converters/jansson/serialize_json_ml_01.xq |
352 | - :) |
353 | -declare function json:serialize( |
354 | - $xml as item()*, |
355 | - $options as element(json-options:options) |
356 | -) as xs:string |
357 | -{ |
358 | - let $validated-options := if(schema:is-validated($options)) then |
359 | - $options |
360 | - else |
361 | - validate{$options} |
362 | - return |
363 | - json:serialize-internal($xml, $validated-options) |
364 | -}; |
365 | - |
366 | -(:~ |
367 | - : The serialize function takes a sequence of nodes as parameter and |
368 | - : transforms each element into a valid JSON string according to the |
369 | - : Simple XDM-JSON mapping described above |
370 | - : |
371 | - : @param $xml a sequence of nodes. |
372 | - : @return a JSON string. |
373 | - : @error json:InvalidXDM if the input $xml is not a valid XDM |
374 | - : representation of JSON or JSON ML. |
375 | - : @example test_json/Queries/converters/jansson/serialize_json_18.xq |
376 | - :) |
377 | -declare function json:serialize( |
378 | - $xml as item()* |
379 | -) as xs:string |
380 | -{ |
381 | - json:serialize-internal($xml, |
382 | - validate { |
383 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
384 | - <json-param name="mapping" value="simple-json" /> |
385 | - </options> |
386 | - } |
387 | - ) |
388 | -}; |
389 | - |
390 | -(:~ |
391 | - : The serialize function takes a sequence of nodes as parameter and |
392 | - : transforms each element into a valid JSON string according to the |
393 | - : JsonML mapping described above. |
394 | - : |
395 | - : @param $xml a sequence of nodes. |
396 | - : @return a JSON string. |
397 | - : @error json:InvalidXDM if the input $xml is not a valid XDM |
398 | - : representation of JSON or JSON ML. |
399 | - : @example test_json/Queries/converters/jansson/serialize_json_ml_04.xq |
400 | - :) |
401 | -declare function json:serialize-ml( |
402 | - $xml as item()* |
403 | -) as xs:string |
404 | -{ |
405 | - json:serialize-internal($xml, |
406 | - validate { |
407 | - <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
408 | - <json-param name="mapping" value="json-ml" type="array"/> |
409 | - </options> |
410 | - } |
411 | - ) |
412 | -}; |
413 | - |
414 | -declare %private function json:serialize-internal( |
415 | - $xml as item()*, |
416 | - $options as element(json-options:options)? |
417 | - ) as xs:string external; |
418 | |
419 | === removed directory 'src/com/zorba-xquery/www/modules/converters/json.xq.src' |
420 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp' |
421 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 2011-12-07 19:24:59 +0000 |
422 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.cpp 1970-01-01 00:00:00 +0000 |
423 | @@ -1,729 +0,0 @@ |
424 | -/* |
425 | - * Copyright 2006-2008 The FLWOR Foundation. |
426 | - * |
427 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
428 | - * you may not use this file except in compliance with the License. |
429 | - * You may obtain a copy of the License at |
430 | - * |
431 | - * http://www.apache.org/licenses/LICENSE-2.0 |
432 | - * |
433 | - * Unless required by applicable law or agreed to in writing, software |
434 | - * distributed under the License is distributed on an "AS IS" BASIS, |
435 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
436 | - * See the License for the specific language governing permissions and |
437 | - * limitations under the License. |
438 | - */ |
439 | - |
440 | -#include <sstream> |
441 | -#include <cstring> |
442 | - |
443 | -#include <zorba/zorba.h> |
444 | -#include <zorba/iterator.h> |
445 | -#include <zorba/store_consts.h> |
446 | - |
447 | -#include <jansson.h> |
448 | - |
449 | -#include "jansson_wrapper.h" |
450 | - |
451 | -namespace zorba |
452 | -{ |
453 | -namespace jsonmodule |
454 | -{ |
455 | -static void serialize_child( |
456 | - const zorba::Item& aElement, |
457 | - std::stringstream& aResultSs, |
458 | - std::stringstream& aErrorLogSs, |
459 | - const std::string& aParentType); |
460 | - |
461 | -bool replace_all( std::string &s, char from, char to ) { |
462 | - bool replaced_any = false; |
463 | - for ( std::string::size_type pos = 0; pos < s.size(); ++pos ) { |
464 | - if ( (pos = s.find( from, pos )) == std::string::npos ) |
465 | - break; |
466 | - s.replace( pos, 1, 1, to ); |
467 | - replaced_any = true; |
468 | - } |
469 | - return replaced_any; |
470 | -} |
471 | - |
472 | -bool replace_all( std::string &s, |
473 | - char const *from, std::string::size_type from_len, |
474 | - char const *to, std::string::size_type to_len ) { |
475 | - bool replaced_any = false; |
476 | - for ( std::string::size_type pos = 0; |
477 | - pos + from_len <= s.size(); pos += to_len ) { |
478 | - if ( (pos = s.find( from, pos, from_len )) == std::string::npos ) |
479 | - break; |
480 | - s.replace( pos, from_len, to, to_len ); |
481 | - replaced_any = true; |
482 | - } |
483 | - return replaced_any; |
484 | -} |
485 | - |
486 | -bool replace_all( std::string &s, char const *from, char const *to ) |
487 | -{ |
488 | - return replace_all( s, from, std::strlen( from ), to, std::strlen( to ) ); |
489 | -} |
490 | - |
491 | -void replace_special_chars( |
492 | - std::string &aValue) |
493 | -{ |
494 | - replace_all(aValue, "\"", "\\\"" ); //quotation mark |
495 | - replace_all(aValue, "\\", "\\\\" ); //reverse solidus |
496 | - replace_all(aValue, "/" , "\\/" ); //solidus |
497 | - replace_all(aValue, "\b", "\\b" ); //backspace |
498 | - replace_all(aValue, "\f", "\\f" ); //formfeed |
499 | - replace_all(aValue, "\n", "\\n" ); //new line |
500 | - replace_all(aValue, "\r", "\\r" ); //carriage return |
501 | - replace_all(aValue, "\t", "\\t" ); //horizontal tab |
502 | - replace_all(aValue, "<" , "<" ); // < |
503 | - replace_all(aValue, ">" , ">" ); // > |
504 | -} |
505 | - |
506 | -static void parse_Json_value( |
507 | - const char *aKey, |
508 | - json_t *aValue, |
509 | - const char* aParentType, |
510 | - std::stringstream& aSs, |
511 | - std::stringstream& aErrorLogSs) |
512 | -{ |
513 | - if(!aValue) |
514 | - return; |
515 | - |
516 | - switch(json_typeof(aValue)) |
517 | - { |
518 | - case JSON_OBJECT: |
519 | - { |
520 | - const char *lKey; |
521 | - json_t *lValue; |
522 | - std::string lTmp(aKey); |
523 | - |
524 | - //<pair name=\"[...]\" type=\"object\">[...]</pair> |
525 | - aSs << "<pair"; |
526 | - if(!lTmp.empty()) |
527 | - aSs << " name=\"" << lTmp << "\""; |
528 | - aSs << " type=\"object\">"; |
529 | - |
530 | - void *lIter = json_object_iter(aValue); |
531 | - while(lIter) |
532 | - { |
533 | - lKey = json_object_iter_key(lIter); |
534 | - lValue = json_object_iter_value(lIter); |
535 | - |
536 | - parse_Json_value(lKey, lValue, "object", aSs, aErrorLogSs); |
537 | - |
538 | - lIter = json_object_iter_next(aValue, lIter); |
539 | - } |
540 | - |
541 | - aSs << "</pair>"; |
542 | - break; |
543 | - } |
544 | - case JSON_ARRAY: |
545 | - { |
546 | - json_t *lValue; |
547 | - zorba::String lName(aKey), lEmptyStr(""); |
548 | - |
549 | - //<pair name=\"[...]\" type=\"array\">[...]</pair> |
550 | - aSs << "<pair name=\"" << lName << "\" type=\"array\">"; |
551 | - |
552 | - for(size_t i = 0; i < json_array_size(aValue); i++) |
553 | - { |
554 | - lValue = json_array_get(aValue, i); |
555 | - |
556 | - parse_Json_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs); |
557 | - } |
558 | - |
559 | - aSs << "</pair>"; |
560 | - break; |
561 | - } |
562 | - default: |
563 | - { |
564 | - //only NULL does not have a value |
565 | - bool lHaveVal = !(json_is_null(aValue)); |
566 | - |
567 | - std::string lType, lValue; |
568 | - if(json_is_null(aValue)) |
569 | - { |
570 | - lType = "null"; |
571 | - lValue = "null"; |
572 | - } |
573 | - else if(json_is_string(aValue)) |
574 | - { |
575 | - lType = "string"; |
576 | - lValue = json_string_value(aValue); |
577 | - } |
578 | - else if(json_is_number(aValue)) |
579 | - { |
580 | - lType = "number"; |
581 | - |
582 | - //json_string_value works just for STRING items so we have to use |
583 | - //json_number_value that returns a double |
584 | - std::ostringstream lOss; |
585 | - lOss << json_number_value(aValue); |
586 | - lValue = lOss.str(); |
587 | - } |
588 | - else if(json_is_boolean(aValue)) |
589 | - { |
590 | - lType = "boolean"; |
591 | - lValue = json_is_true(aValue)?"true":"false"; |
592 | - } |
593 | - |
594 | - zorba::String lName(aKey); |
595 | - std::string lParent(aParentType); |
596 | - std::string lItemName = (lParent.compare("object") == 0)?"pair":"item"; |
597 | - |
598 | - |
599 | - aSs << "<" << lItemName; |
600 | - if(!lName.empty()) |
601 | - { |
602 | - aSs <<" name=\"" << lName << "\""; |
603 | - } |
604 | - aSs << " type=\"" << lType; |
605 | - if(lHaveVal) |
606 | - { |
607 | - replace_special_chars(lValue); |
608 | - aSs << "\">" << lValue << "</" << lItemName << ">"; |
609 | - } |
610 | - else |
611 | - aSs << "\"/>"; |
612 | - |
613 | - break; |
614 | - } |
615 | - } |
616 | -} |
617 | - |
618 | - |
619 | -void JSON_parse( |
620 | - const char* aJsonString, |
621 | - std::stringstream& aSs, |
622 | - std::stringstream& aErrorLogSs) |
623 | -{ |
624 | - json_error_t lerror; |
625 | - json_t *ljson; |
626 | - |
627 | - #if JANSSON_MAJOR_VERSION < 2 |
628 | - ljson = json_loads(aJsonString, &lerror); |
629 | - #else |
630 | - ljson = json_loads(aJsonString, 0, &lerror); |
631 | - #endif |
632 | - |
633 | - if(!ljson) |
634 | - { |
635 | - #if JANSSON_MAJOR_VERSION < 2 |
636 | - aErrorLogSs << "Error at line: " << lerror.line << std::endl; |
637 | - aErrorLogSs << lerror.text << std::endl; |
638 | - #else |
639 | - aErrorLogSs << "Error at line: " << lerror.line << " column: " << lerror.column << " position: " << lerror.position << std::endl; |
640 | - aErrorLogSs << lerror.text << std::endl; |
641 | - #endif |
642 | - return; |
643 | - } |
644 | - |
645 | - const char *lKey; |
646 | - json_t *lValue; |
647 | - lKey = json_object_iter_key(ljson); |
648 | - |
649 | - if(json_is_object(ljson)) |
650 | - { |
651 | - aSs << "<json type=\"object\">"; |
652 | - void *lIter = json_object_iter(ljson); |
653 | - while(lIter) |
654 | - { |
655 | - lKey = json_object_iter_key(lIter); |
656 | - lValue = json_object_iter_value(lIter); |
657 | - |
658 | - parse_Json_value(lKey, lValue, "object", aSs, aErrorLogSs); |
659 | - |
660 | - lIter = json_object_iter_next(ljson, lIter); |
661 | - } |
662 | - aSs << "</json>"; |
663 | - } |
664 | - else if(json_is_array(ljson)) |
665 | - { |
666 | - std::string lEmptyStr(""); |
667 | - aSs << "<json type=\"array\">"; |
668 | - for(size_t i = 0; i < json_array_size(ljson); i++) |
669 | - { |
670 | - lValue = json_array_get(ljson, i); |
671 | - |
672 | - parse_Json_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs); |
673 | - } |
674 | - aSs << "</json>"; |
675 | - } |
676 | - else |
677 | - aErrorLogSs << "Either one of ARRAY and OBJECT are considered valid JSON." << std::endl; |
678 | - |
679 | -} |
680 | - |
681 | -void get_text_value( |
682 | - const zorba::Item& aElement, |
683 | - zorba::String& aValue) |
684 | -{ |
685 | - zorba::Iterator_t lChildrenIt; |
686 | - zorba::Item lChild; |
687 | - |
688 | - lChildrenIt = aElement.getChildren(); |
689 | - lChildrenIt->open(); |
690 | - while (lChildrenIt->next(lChild)) |
691 | - { |
692 | - if (lChild.getNodeKind() == store::StoreConsts::textNode) |
693 | - aValue = lChild.getStringValue(); |
694 | - } |
695 | - lChildrenIt->close(); |
696 | -} |
697 | - |
698 | -void serialize_element( |
699 | - const zorba::Item& aElement, |
700 | - std::stringstream& aResultSs, |
701 | - std::stringstream& aErrorLogSs, |
702 | - const std::string& aParentType) |
703 | -{ |
704 | - zorba::Iterator_t lAttrIt, lChildrenIt; |
705 | - zorba::Item lAttr, lChild; |
706 | - zorba::String lName, lType; |
707 | - |
708 | - Item lNodeNameItem; |
709 | - aElement.getNodeName(lNodeNameItem); |
710 | - |
711 | - if(((aParentType.compare("object") == 0) && |
712 | - !(lNodeNameItem.getStringValue() == "pair" || lNodeNameItem.getStringValue() == "json")) || |
713 | - ((aParentType.compare("array") == 0) && lNodeNameItem.getStringValue() != "item")) |
714 | - { |
715 | - aErrorLogSs << "'Object' should have only 'pair' children and 'array' should have only 'item' children." << std::endl; |
716 | - return; |
717 | - } |
718 | - |
719 | - lAttrIt = aElement.getAttributes(); |
720 | - lAttrIt->open(); |
721 | - while (lAttrIt->next(lAttr)) |
722 | - { |
723 | - if(lAttr.getNodeKind() == store::StoreConsts::attributeNode) |
724 | - { |
725 | - Item lNodeNameItem; |
726 | - lAttr.getNodeName(lNodeNameItem); |
727 | - if(lNodeNameItem.getStringValue() == "type") |
728 | - lType = lAttr.getStringValue(); |
729 | - else if(lNodeNameItem.getStringValue() == "name") |
730 | - lName = lAttr.getStringValue(); |
731 | - } |
732 | - } |
733 | - lAttrIt->close(); |
734 | - |
735 | - if(lType.empty()) |
736 | - { |
737 | - aErrorLogSs << "Element does not have a 'type' attribute defined." << std::endl; |
738 | - return; |
739 | - } |
740 | - |
741 | - if(lType == "object") |
742 | - { |
743 | - if(!lName.empty()) |
744 | - aResultSs << "\"" << lName.c_str() << "\": "; |
745 | - |
746 | - //serialize every children |
747 | - aResultSs << "{"; |
748 | - serialize_child(aElement, aResultSs, aErrorLogSs, "object"); |
749 | - aResultSs << "}"; |
750 | - } |
751 | - else if(lType == "array") |
752 | - { |
753 | - if(!lName.empty()) |
754 | - aResultSs << "\"" << lName.c_str() << "\": "; |
755 | - |
756 | - //serialize every children |
757 | - aResultSs << "["; |
758 | - serialize_child(aElement, aResultSs, aErrorLogSs, "array"); |
759 | - aResultSs << "]"; |
760 | - } |
761 | - else if(lType == "string") |
762 | - { |
763 | - zorba::String lValue; |
764 | - get_text_value(aElement, lValue); |
765 | - zorba::Item lNodeNameItem; |
766 | - aElement.getNodeName(lNodeNameItem); |
767 | - if(lNodeNameItem.getStringValue() == "pair") |
768 | - { |
769 | - if(lName.empty()) |
770 | - { |
771 | - aErrorLogSs << "Element does not have a 'name' attribute defined." << std::endl; |
772 | - return; |
773 | - } |
774 | - if(aParentType.compare("object") != 0) |
775 | - { |
776 | - aErrorLogSs << "'Pair' is allowed only as part of an object." << std::endl; |
777 | - return; |
778 | - } |
779 | - aResultSs << "\"" << lName.c_str() << "\": "; |
780 | - } |
781 | - aResultSs << "\"" << lValue.c_str() << "\""; |
782 | - } |
783 | - else if(lType == "null") |
784 | - { |
785 | - zorba::Item lNodeNameItem; |
786 | - aElement.getNodeName(lNodeNameItem); |
787 | - if(lNodeNameItem.getStringValue() == "pair") |
788 | - { |
789 | - aResultSs << "\"" << lName.c_str() << "\": "; |
790 | - } |
791 | - aResultSs << "null"; |
792 | - } |
793 | - else if(lType == "number" || |
794 | - lType == "boolean") |
795 | - { |
796 | - zorba::String lValue; |
797 | - get_text_value(aElement, lValue); |
798 | - zorba::Item lNodeNameItem; |
799 | - aElement.getNodeName(lNodeNameItem); |
800 | - if(lNodeNameItem.getStringValue() == "pair") |
801 | - { |
802 | - aResultSs << "\"" << lName.c_str() << "\": "; |
803 | - } |
804 | - aResultSs << lValue.c_str(); |
805 | - } |
806 | - else |
807 | - { |
808 | - aErrorLogSs << "Type '" << lType.c_str() << "' not recognized." << std::endl; |
809 | - return; |
810 | - } |
811 | -} |
812 | - |
813 | -void serialize_child( |
814 | - const zorba::Item& aElement, |
815 | - std::stringstream& aResultSs, |
816 | - std::stringstream& aErrorLogSs, |
817 | - const std::string& aParentType) |
818 | -{ |
819 | - bool lFirst = true; |
820 | - zorba::Iterator_t lChildrenIt; |
821 | - zorba::Item lChild; |
822 | - |
823 | - lChildrenIt = aElement.getChildren(); |
824 | - lChildrenIt->open(); |
825 | - while (lChildrenIt->next(lChild)) |
826 | - { |
827 | - if(lChild.getNodeKind() == store::StoreConsts::elementNode) |
828 | - { |
829 | - if(!lFirst) |
830 | - aResultSs << ", "; |
831 | - |
832 | - serialize_element(lChild, aResultSs, aErrorLogSs, aParentType); |
833 | - lFirst = false; |
834 | - } |
835 | - } |
836 | - lChildrenIt->close(); |
837 | -} |
838 | - |
839 | -void JSON_serialize( |
840 | - const zorba::Item& aElement, |
841 | - std::stringstream& aResultSs, |
842 | - std::stringstream& aErrorLogSs) |
843 | -{ |
844 | - if (aElement.isNull()) |
845 | - { |
846 | - aErrorLogSs << "Passed a NULL element to the JSON serializer." << std::endl; |
847 | - return; |
848 | - } |
849 | - |
850 | - if(!(aElement.getNodeKind() == store::StoreConsts::documentNode || |
851 | - aElement.getNodeKind() == store::StoreConsts::elementNode)) |
852 | - { |
853 | - aErrorLogSs << "Passed an incorrect Item to the JSON serializer." << std::endl; |
854 | - return; |
855 | - } |
856 | - |
857 | - Item lNodeNameItem; |
858 | - aElement.getNodeName(lNodeNameItem); |
859 | - |
860 | - if(!lNodeNameItem.isNull() && lNodeNameItem.getStringValue() != "json") |
861 | - { |
862 | - aErrorLogSs << "This is not a JSON element." << std::endl; |
863 | - return; |
864 | - } |
865 | - |
866 | - if(aElement.getNodeKind() == store::StoreConsts::documentNode) |
867 | - { |
868 | - serialize_child(aElement, aResultSs, aErrorLogSs, "object"); |
869 | - return; |
870 | - } |
871 | - |
872 | - zorba::Iterator_t lAttrIt; |
873 | - zorba::Item lAttr; |
874 | - zorba::String lType; |
875 | - lAttrIt = aElement.getAttributes(); |
876 | - lAttrIt->open(); |
877 | - while (lAttrIt->next(lAttr)) |
878 | - { |
879 | - if(lAttr.getNodeKind() == store::StoreConsts::attributeNode) |
880 | - { |
881 | - Item lNodeNameItem; |
882 | - lAttr.getNodeName(lNodeNameItem); |
883 | - if(lNodeNameItem.getStringValue() == "type") |
884 | - lType = lAttr.getStringValue(); |
885 | - else |
886 | - { |
887 | - aErrorLogSs << "Could not retrieve the type of the Json root." << std::endl; |
888 | - return; |
889 | - } |
890 | - } |
891 | - } |
892 | - lAttrIt->close(); |
893 | - |
894 | - |
895 | - if(lType == "object") |
896 | - aResultSs << "{"; |
897 | - else |
898 | - aResultSs << "["; |
899 | - |
900 | - serialize_child(aElement, aResultSs, aErrorLogSs, "object"); |
901 | - |
902 | - if(lType == "object") |
903 | - aResultSs << "}"; |
904 | - else |
905 | - aResultSs << "]"; |
906 | -} |
907 | - |
908 | -static void parse_JSON_ML_value( |
909 | - const char *aKey, |
910 | - json_t *aValue, |
911 | - const char* aParentType, |
912 | - std::stringstream& aSs, |
913 | - std::stringstream& aErrorLogSs, |
914 | - bool aShouldClose = false) |
915 | -{ |
916 | - if(!aValue) |
917 | - return; |
918 | - |
919 | - switch(json_typeof(aValue)) |
920 | - { |
921 | - case JSON_OBJECT: |
922 | - { |
923 | - const char *lKey; |
924 | - json_t *lValue; |
925 | - std::string lTmp(aKey); |
926 | - |
927 | - void *lIter = json_object_iter(aValue); |
928 | - while(lIter) |
929 | - { |
930 | - lKey = json_object_iter_key(lIter); |
931 | - lValue = json_object_iter_value(lIter); |
932 | - |
933 | - parse_JSON_ML_value(lKey, lValue, "object", aSs, aErrorLogSs); |
934 | - |
935 | - lIter = json_object_iter_next(aValue, lIter); |
936 | - } |
937 | - aSs << ">"; |
938 | - break; |
939 | - } |
940 | - case JSON_ARRAY: |
941 | - { |
942 | - json_t *lValue; |
943 | - zorba::String lName(""), lEmptyStr(""); |
944 | - bool lShouldClose = true; |
945 | - |
946 | - std::string lParent(aParentType); |
947 | - if(lParent.compare("array") == 0) |
948 | - { |
949 | - for(size_t i = 0; i < json_array_size(aValue); i++) |
950 | - { |
951 | - lValue = json_array_get(aValue, i); |
952 | - |
953 | - if(json_is_object(lValue)) |
954 | - lShouldClose = false; |
955 | - } |
956 | - |
957 | - aSs << "<"; |
958 | - } |
959 | - |
960 | - std::string lTmp; |
961 | - for(size_t i = 0; i < json_array_size(aValue); i++) |
962 | - { |
963 | - lValue = json_array_get(aValue, i); |
964 | - |
965 | - parse_JSON_ML_value(lEmptyStr.c_str(), lValue, "array", aSs, aErrorLogSs, lShouldClose); |
966 | - |
967 | - if(lShouldClose) |
968 | - lShouldClose = false; |
969 | - } |
970 | - |
971 | - lValue = json_array_get(aValue, 0); |
972 | - if(json_is_string(lValue)) |
973 | - lName = json_string_value(lValue); |
974 | - |
975 | - if(lParent.compare("array") == 0) |
976 | - aSs << "</" << lName << ">"; |
977 | - |
978 | - break; |
979 | - } |
980 | - default: |
981 | - { |
982 | - std::string lType, lValue; |
983 | - if(json_is_string(aValue)) |
984 | - { |
985 | - lType = "string"; |
986 | - lValue = json_string_value(aValue); |
987 | - } |
988 | - else if(json_is_boolean(aValue)) |
989 | - { |
990 | - lType = json_is_true(aValue)?"true":"false"; |
991 | - lValue = lType; |
992 | - } |
993 | - else if(json_is_number(aValue)) |
994 | - { |
995 | - lType = "number"; |
996 | - |
997 | - //json_string_value works just for STRING items so we have to use |
998 | - //json_number_value that returns a double |
999 | - std::ostringstream lOss; |
1000 | - lOss << json_number_value(aValue); |
1001 | - lValue = lOss.str(); |
1002 | - } |
1003 | - else if(json_is_null(aValue)) |
1004 | - { |
1005 | - lType = lValue = "null"; |
1006 | - } |
1007 | - |
1008 | - zorba::String lName(aKey); |
1009 | - std::string lParent(aParentType); |
1010 | - |
1011 | - if(lParent.compare("array") == 0) |
1012 | - aSs << lValue; |
1013 | - else if(lParent.compare("object") == 0) |
1014 | - { |
1015 | - aSs << " " << lName << "="; |
1016 | - replace_special_chars(lValue); |
1017 | - if(lType.compare("string") == 0) |
1018 | - aSs << "\"" << lValue << "\""; |
1019 | - else |
1020 | - aSs << lValue; |
1021 | - } |
1022 | - |
1023 | - if(aShouldClose) |
1024 | - aSs << ">"; |
1025 | - |
1026 | - break; |
1027 | - } |
1028 | - } |
1029 | -} |
1030 | - |
1031 | -void JSON_ML_parse( |
1032 | - const char* aJsonString, |
1033 | - std::stringstream& aSs, |
1034 | - std::stringstream& aErrorLogSs) |
1035 | -{ |
1036 | - json_error_t lerror; |
1037 | - json_t *ljson; |
1038 | - zorba::String lEmptyStr(""); |
1039 | - |
1040 | - #if JANSSON_MAJOR_VERSION < 2 |
1041 | - ljson = json_loads(aJsonString, &lerror); |
1042 | - #else |
1043 | - ljson = json_loads(aJsonString, 0, &lerror); |
1044 | - #endif |
1045 | - if(!ljson) |
1046 | - { |
1047 | - #if JANSSON_MAJOR_VERSION < 2 |
1048 | - aErrorLogSs << "Error at line: " << lerror.line << std::endl; |
1049 | - aErrorLogSs << lerror.text << std::endl; |
1050 | - #else |
1051 | - aErrorLogSs << "Error at line: " << lerror.line << " column: " << lerror.column << " position: " << lerror.position << std::endl; |
1052 | - aErrorLogSs << lerror.text << std::endl; |
1053 | - #endif |
1054 | - return; |
1055 | - } |
1056 | - |
1057 | - if(!json_is_array(ljson)) |
1058 | - aErrorLogSs << "ARRAY is the only accepted root for the Json-ML mapping." << std::endl; |
1059 | - |
1060 | - parse_JSON_ML_value(lEmptyStr.c_str(), ljson, "array", aSs, aErrorLogSs); |
1061 | -} |
1062 | - |
1063 | -void JSON_ML_serialize( |
1064 | - const zorba::Item& aElement, |
1065 | - std::stringstream& aResultSs, |
1066 | - std::stringstream& aErrorLogSs) |
1067 | -{ |
1068 | - if (aElement.isNull()) |
1069 | - { |
1070 | - aErrorLogSs << "Passed a NULL element to the JSON serializer." << std::endl; |
1071 | - return; |
1072 | - } |
1073 | - |
1074 | - if(!(aElement.getNodeKind() == store::StoreConsts::documentNode || |
1075 | - aElement.getNodeKind() == store::StoreConsts::elementNode || |
1076 | - aElement.getNodeKind() == store::StoreConsts::textNode)) |
1077 | - { |
1078 | - aErrorLogSs << "Passed an incorrect Item to the JSON serializer." << std::endl; |
1079 | - return; |
1080 | - } |
1081 | - |
1082 | - if(aElement.getNodeKind() == store::StoreConsts::textNode) |
1083 | - { |
1084 | - aResultSs << "\"" << aElement.getStringValue().c_str() << "\""; |
1085 | - return; |
1086 | - } |
1087 | - |
1088 | - Item lNodeNameItem; |
1089 | - aElement.getNodeName(lNodeNameItem); |
1090 | - |
1091 | - aResultSs << "[\"" << lNodeNameItem.getStringValue().c_str() << "\""; |
1092 | - |
1093 | - zorba::Iterator_t lAttrIt; |
1094 | - zorba::Item lAttr; |
1095 | - zorba::String lType; |
1096 | - bool lHasAttributes = false; |
1097 | - |
1098 | - lAttrIt = aElement.getAttributes(); |
1099 | - lAttrIt->open(); |
1100 | - while (lAttrIt->next(lAttr)) |
1101 | - { |
1102 | - if(lAttr.getNodeKind() == store::StoreConsts::attributeNode) |
1103 | - { |
1104 | - lHasAttributes = true; |
1105 | - break; |
1106 | - } |
1107 | - } |
1108 | - lAttrIt->close(); |
1109 | - |
1110 | - if(lHasAttributes) |
1111 | - aResultSs << ",{"; |
1112 | - |
1113 | - bool lFirst = true; |
1114 | - lAttrIt = aElement.getAttributes(); |
1115 | - lAttrIt->open(); |
1116 | - while (lAttrIt->next(lAttr)) |
1117 | - { |
1118 | - if(lAttr.getNodeKind() == store::StoreConsts::attributeNode) |
1119 | - { |
1120 | - Item lNodeNameItem; |
1121 | - lAttr.getNodeName(lNodeNameItem); |
1122 | - if(!lFirst) |
1123 | - aResultSs << ","; |
1124 | - |
1125 | - aResultSs << "\"" << lNodeNameItem.getStringValue().c_str() << "\":"; |
1126 | - aResultSs << "\"" << lAttr.getStringValue().c_str() << "\""; |
1127 | - lFirst = false; |
1128 | - } |
1129 | - } |
1130 | - lAttrIt->close(); |
1131 | - if(lHasAttributes) |
1132 | - aResultSs << "}"; |
1133 | - |
1134 | - zorba::Iterator_t lChildrenIt; |
1135 | - zorba::Item lChild; |
1136 | - |
1137 | - lChildrenIt = aElement.getChildren(); |
1138 | - lChildrenIt->open(); |
1139 | - while (lChildrenIt->next(lChild)) |
1140 | - { |
1141 | - aResultSs << ","; |
1142 | - if (lChild.getNodeKind() == store::StoreConsts::elementNode || |
1143 | - lChild.getNodeKind() == store::StoreConsts::textNode) |
1144 | - JSON_ML_serialize(lChild, aResultSs, aErrorLogSs); |
1145 | - } |
1146 | - lChildrenIt->close(); |
1147 | - |
1148 | - aResultSs << "]"; |
1149 | -} |
1150 | - |
1151 | - } /* namespace jsonmodule */ |
1152 | -} /* namespace zorba */ |
1153 | |
1154 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h' |
1155 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h 2011-10-06 07:40:17 +0000 |
1156 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/jansson_wrapper.h 1970-01-01 00:00:00 +0000 |
1157 | @@ -1,56 +0,0 @@ |
1158 | -/* |
1159 | - * Copyright 2006-2008 The FLWOR Foundation. |
1160 | - * |
1161 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1162 | - * you may not use this file except in compliance with the License. |
1163 | - * You may obtain a copy of the License at |
1164 | - * |
1165 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1166 | - * |
1167 | - * Unless required by applicable law or agreed to in writing, software |
1168 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1169 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1170 | - * See the License for the specific language governing permissions and |
1171 | - * limitations under the License. |
1172 | - */ |
1173 | - |
1174 | -#ifndef ZORBA_JSONMODULE_JANSSON_WRAPPER_H |
1175 | -#define ZORBA_JSONMODULE_JANSSON_WRAPPER_H |
1176 | - |
1177 | -#include <zorba/item_factory.h> |
1178 | -#include <zorba/item.h> |
1179 | - |
1180 | -namespace zorba |
1181 | -{ |
1182 | - namespace jsonmodule |
1183 | - { |
1184 | - //Json parse and serialize: http://www.json.org/ |
1185 | - //according to the mapping proposed by john snelson: |
1186 | - //http://snelson.org.uk/archives/2008/02/parsing_json_in.php#more |
1187 | - void JSON_parse( |
1188 | - const char* aJsonString, |
1189 | - std::stringstream& aSs, |
1190 | - std::stringstream& aErrorLogSs); |
1191 | - |
1192 | - void JSON_serialize( |
1193 | - const zorba::Item& aElement, |
1194 | - std::stringstream& aResultSs, |
1195 | - std::stringstream& aErrorLogSs); |
1196 | - |
1197 | - |
1198 | - //Json ML parse and serialize: http://jsonml.org/ |
1199 | - void JSON_ML_parse( |
1200 | - const char* aJsonString, |
1201 | - std::stringstream& aSs, |
1202 | - std::stringstream& aErrorLogSs); |
1203 | - |
1204 | - |
1205 | - void JSON_ML_serialize( |
1206 | - const zorba::Item& aElement, |
1207 | - std::stringstream& aResultSs, |
1208 | - std::stringstream& aErrorLogSs); |
1209 | - |
1210 | - } /* namespace jsonmodule */ |
1211 | -} /* namespace zorba */ |
1212 | - |
1213 | -#endif //ZORBA_JSONMODULE_JANSSON_WRAPPER_H |
1214 | \ No newline at end of file |
1215 | |
1216 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp' |
1217 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp 2011-08-18 22:09:48 +0000 |
1218 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/json.cpp 1970-01-01 00:00:00 +0000 |
1219 | @@ -1,317 +0,0 @@ |
1220 | -/* |
1221 | - * Copyright 2006-2008 The FLWOR Foundation. |
1222 | - * |
1223 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1224 | - * you may not use this file except in compliance with the License. |
1225 | - * You may obtain a copy of the License at |
1226 | - * |
1227 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1228 | - * |
1229 | - * Unless required by applicable law or agreed to in writing, software |
1230 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1231 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1232 | - * See the License for the specific language governing permissions and |
1233 | - * limitations under the License. |
1234 | - */ |
1235 | - |
1236 | -#include <sstream> |
1237 | -#include <cassert> |
1238 | - |
1239 | -#include <zorba/empty_sequence.h> |
1240 | -#include <zorba/singleton_item_sequence.h> |
1241 | -#include <zorba/diagnostic_list.h> |
1242 | -#include <zorba/user_exception.h> |
1243 | -#include <zorba/item.h> |
1244 | -#include <zorba/store_consts.h> |
1245 | - |
1246 | -#include "json.h" |
1247 | -#include "jansson_wrapper.h" |
1248 | - |
1249 | -namespace zorba |
1250 | -{ |
1251 | - namespace jsonmodule |
1252 | - { |
1253 | -zorba::String |
1254 | -JsonFunction::getOptionValue(zorba::Item& aOptionsItem, const char* aOptionName) const |
1255 | -{ |
1256 | - zorba::Iterator_t lChildrenIt, lAttrIt; |
1257 | - zorba::Item lChild, lAttr, lNodeNameItem; |
1258 | - bool lCorrectChild = false; |
1259 | - |
1260 | - lChildrenIt = aOptionsItem.getChildren(); |
1261 | - lChildrenIt->open(); |
1262 | - while (lChildrenIt->next(lChild)) |
1263 | - { |
1264 | - if (lChild.getNodeKind() == store::StoreConsts::elementNode) |
1265 | - { |
1266 | - lAttrIt = lChild.getAttributes(); |
1267 | - lAttrIt->open(); |
1268 | - while (lAttrIt->next(lAttr)) |
1269 | - { |
1270 | - if(lAttr.getNodeKind() == store::StoreConsts::attributeNode) |
1271 | - { |
1272 | - lAttr.getNodeName(lNodeNameItem); |
1273 | - if(!lCorrectChild && |
1274 | - lNodeNameItem.getStringValue() == "name") |
1275 | - lCorrectChild = lAttr.getStringValue() == "mapping"; |
1276 | - else if(lCorrectChild && |
1277 | - lNodeNameItem.getStringValue() == "value") |
1278 | - return lAttr.getStringValue(); |
1279 | - } |
1280 | - } |
1281 | - } |
1282 | - } |
1283 | - lChildrenIt->close(); |
1284 | - |
1285 | - return zorba::String(""); |
1286 | -} |
1287 | -//***************************************************************************** |
1288 | -//***************************************************************************** |
1289 | - |
1290 | -ParseFunction::ParseFunction(const JsonModule* aModule) |
1291 | -: JsonFunction(aModule) |
1292 | -{ |
1293 | -} |
1294 | - |
1295 | -ItemSequence_t |
1296 | -ParseFunction::evaluate( |
1297 | - const ExternalFunction::Arguments_t& aArgs, |
1298 | - const StaticContext* aSctxCtx, |
1299 | - const DynamicContext* aDynCtx) const |
1300 | - { |
1301 | - zorba::Item lStringItem, lOptionsItem, lResItem; |
1302 | - zorba::String lBaseUri, lJsonMapping, lOptionName("mapping"); |
1303 | - std::stringstream lSs, lErrorLogSs; |
1304 | - |
1305 | - if (aArgs.size() >= 1) |
1306 | - { |
1307 | - Iterator_t lArg0Iter = aArgs[0]->getIterator(); |
1308 | - lArg0Iter->open(); |
1309 | - lArg0Iter->next(lStringItem); |
1310 | - lArg0Iter->close(); |
1311 | - } |
1312 | - |
1313 | - lBaseUri = aSctxCtx->getBaseURI(); |
1314 | - |
1315 | - if (aArgs.size() == 2) |
1316 | - { |
1317 | - Iterator_t lArg0Iter = aArgs[1]->getIterator(); |
1318 | - lArg0Iter->open(); |
1319 | - lArg0Iter->next(lOptionsItem); |
1320 | - lArg0Iter->close(); |
1321 | - } |
1322 | - |
1323 | - lJsonMapping = getOptionValue(lOptionsItem, lOptionName.c_str()); |
1324 | - |
1325 | - if(lJsonMapping == "simple-json") |
1326 | - { |
1327 | - JSON_parse(lStringItem.getStringValue().c_str(), lSs, lErrorLogSs); |
1328 | - } |
1329 | - else // if(lJsonMapping == "json-ml") |
1330 | - { |
1331 | - assert(lJsonMapping == "json-ml"); // the schema makes sure that this is the case |
1332 | - JSON_ML_parse(lStringItem.getStringValue().c_str(), lSs, lErrorLogSs); |
1333 | - } |
1334 | - |
1335 | - if(!lErrorLogSs.str().empty()) |
1336 | - { |
1337 | - zorba::Item lError = theModule->getItemFactory()->createQName(theModule->getURI(), "ParseError"); |
1338 | - throw USER_EXCEPTION(lError, lErrorLogSs.str()); |
1339 | - } |
1340 | - |
1341 | - XmlDataManager* lDataManager = Zorba::getInstance(0)->getXmlDataManager(); |
1342 | - Item lItem = lDataManager->parseXML(lSs); |
1343 | - |
1344 | - return ItemSequence_t(new SingletonItemSequence(lItem)); |
1345 | - } |
1346 | - |
1347 | -//***************************************************************************** |
1348 | -//***************************************************************************** |
1349 | -SerializeFunction::StringStreamSequence::StringStreamSequence(ItemSequence* input) |
1350 | - : input_iter(input->getIterator()), |
1351 | - is(new std::istream(this)) |
1352 | -{ |
1353 | - line_index = 0; |
1354 | - has_next = true; |
1355 | - is_open = false; |
1356 | - open_count = 0; |
1357 | - input_iter->open(); |
1358 | -} |
1359 | - |
1360 | -void SerializeFunction::StringStreamSequence::open() |
1361 | -{ |
1362 | - is_open = true; |
1363 | - line_index = 1; |
1364 | - if(open_count) |
1365 | - { |
1366 | - is->seekg(0); |
1367 | - if(is->fail()) |
1368 | - throw USER_EXCEPTION(theFactory->createQName( |
1369 | - "http://www.zorba-xquery.com/modules/converters/json", |
1370 | - "InvalidStream"), |
1371 | - "Cannot reset streamable string item"); |
1372 | - } |
1373 | - open_count++; |
1374 | -} |
1375 | - |
1376 | -void SerializeFunction::StringStreamSequence::close() |
1377 | -{ |
1378 | - is_open = false; |
1379 | -} |
1380 | - |
1381 | -bool SerializeFunction::StringStreamSequence::isOpen() const |
1382 | -{ |
1383 | - return is_open; |
1384 | -} |
1385 | - |
1386 | -bool SerializeFunction::StringStreamSequence::next( Item &result ) |
1387 | -{ |
1388 | - assert(is_open); |
1389 | - |
1390 | - if(!has_next) |
1391 | - return false; |
1392 | - result = streamable_item; |
1393 | - has_next = false; |
1394 | - return true; |
1395 | -} |
1396 | - |
1397 | -bool SerializeFunction::StringStreamSequence::next(std::string &result_string) |
1398 | -{ |
1399 | - if(!input_iter->next(node_item)) |
1400 | - return false; |
1401 | - |
1402 | - std::stringstream lSs, lErrorLogSs; |
1403 | - |
1404 | - if(theMapping == "simple-json") |
1405 | - JSON_serialize(node_item, lSs, lErrorLogSs); |
1406 | - else if(theMapping == "json-ml") |
1407 | - JSON_ML_serialize(node_item, lSs, lErrorLogSs); |
1408 | - |
1409 | - if(!lErrorLogSs.str().empty()) |
1410 | - { |
1411 | - throw USER_EXCEPTION( |
1412 | - theFactory->createQName( |
1413 | - "http://www.zorba-xquery.com/modules/converters/json", |
1414 | - "InvalidXDM"), |
1415 | - lErrorLogSs.str()); |
1416 | - } |
1417 | - |
1418 | - result_string = lSs.str(); |
1419 | - return true; |
1420 | -} |
1421 | - |
1422 | -bool SerializeFunction::StringStreamSequence::reset() |
1423 | -{ |
1424 | - input_iter->close(); |
1425 | - input_iter->open(); |
1426 | - return true; |
1427 | -} |
1428 | - |
1429 | - |
1430 | -SerializeFunction::SerializeFunction(const JsonModule* aModule) |
1431 | -: JsonFunction(aModule) |
1432 | -{ |
1433 | -} |
1434 | - |
1435 | -ItemSequence_t |
1436 | -SerializeFunction::evaluate( |
1437 | - const ExternalFunction::Arguments_t& aArgs, |
1438 | - const StaticContext* aSctxCtx, |
1439 | - const DynamicContext* aDynCtx) const |
1440 | - { |
1441 | - zorba::Item lOptionsItem, lResItem; |
1442 | - zorba::String lBaseUri, lJsonMapping, lOptionName("mapping"); |
1443 | - std::stringstream lSs, lErrorLogSs; |
1444 | - |
1445 | - lBaseUri = aSctxCtx->getBaseURI(); |
1446 | - |
1447 | - if (aArgs.size() == 2) |
1448 | - { |
1449 | - Iterator_t lArg0Iter = aArgs[1]->getIterator(); |
1450 | - lArg0Iter->open(); |
1451 | - lArg0Iter->next(lOptionsItem); |
1452 | - lArg0Iter->close(); |
1453 | - } |
1454 | - |
1455 | - lJsonMapping = getOptionValue(lOptionsItem, lOptionName.c_str()); |
1456 | - |
1457 | - if(lJsonMapping != "simple-json" && |
1458 | - lJsonMapping != "json-ml") |
1459 | - { |
1460 | - zorba::Item lError = theModule->getItemFactory()->createQName(theModule->getURI(), "WrongParam"); |
1461 | - lErrorLogSs << "Mapping type '" << lJsonMapping << "' not supported.\nPossible values are 'simple-json' or 'json-ml'."; |
1462 | - throw USER_EXCEPTION(lError, lErrorLogSs.str()); |
1463 | - } |
1464 | - |
1465 | - StringStreamSequence *stream_sequence = new StringStreamSequence((ItemSequence*)aArgs[0]); |
1466 | - stream_sequence->theMapping = lJsonMapping; |
1467 | - stream_sequence->theFactory = theModule->getItemFactory(); |
1468 | - stream_sequence->streamable_item = |
1469 | - theModule->getItemFactory()->createStreamableString( |
1470 | - *(stream_sequence->is), &StringStreamSequence::releaseStream); |
1471 | - |
1472 | - return ItemSequence_t(stream_sequence); |
1473 | - |
1474 | - } |
1475 | - |
1476 | -//***************************************************************************** |
1477 | -//***************************************************************************** |
1478 | - |
1479 | -ItemFactory* JsonModule::theFactory = 0; |
1480 | - |
1481 | -JsonModule::~JsonModule() |
1482 | -{ |
1483 | - for ( FuncMap_t::const_iterator lIter = theFunctions.begin(); |
1484 | - lIter != theFunctions.end(); |
1485 | - ++lIter) |
1486 | - { |
1487 | - delete lIter->second; |
1488 | - } |
1489 | - theFunctions.clear(); |
1490 | -} |
1491 | - |
1492 | -ExternalFunction* |
1493 | -JsonModule::getExternalFunction(const String& aLocalname) |
1494 | -{ |
1495 | - ExternalFunction*& lFunc = theFunctions[aLocalname]; |
1496 | - if (!lFunc) |
1497 | - { |
1498 | - if (1 == 0) |
1499 | - { } |
1500 | - else if (aLocalname == "parse-internal") |
1501 | - { |
1502 | - lFunc = new ParseFunction(this); |
1503 | - } |
1504 | - else if (aLocalname == "serialize-internal") |
1505 | - { |
1506 | - lFunc = new SerializeFunction(this); |
1507 | - } |
1508 | - } |
1509 | - return lFunc; |
1510 | -} |
1511 | - |
1512 | -void |
1513 | -JsonModule::destroy() |
1514 | -{ |
1515 | - if (!dynamic_cast<JsonModule*>(this)) |
1516 | - { |
1517 | - return; |
1518 | - } |
1519 | - delete this; |
1520 | -} |
1521 | -//***************************************************************************** |
1522 | -//***************************************************************************** |
1523 | - |
1524 | - } /* namespace jsonmodule */ |
1525 | -} /* namespace zorba */ |
1526 | - |
1527 | -#ifdef WIN32 |
1528 | -# define DLL_EXPORT __declspec(dllexport) |
1529 | -#else |
1530 | -# define DLL_EXPORT __attribute__ ((visibility("default"))) |
1531 | -#endif |
1532 | - |
1533 | -extern "C" DLL_EXPORT zorba::ExternalModule* createModule() |
1534 | -{ |
1535 | - return new zorba::jsonmodule::JsonModule(); |
1536 | -} |
1537 | |
1538 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h' |
1539 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h 2011-10-06 07:40:17 +0000 |
1540 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/json.h 1970-01-01 00:00:00 +0000 |
1541 | @@ -1,167 +0,0 @@ |
1542 | -/* |
1543 | - * Copyright 2006-2008 The FLWOR Foundation. |
1544 | - * |
1545 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1546 | - * you may not use this file except in compliance with the License. |
1547 | - * You may obtain a copy of the License at |
1548 | - * |
1549 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1550 | - * |
1551 | - * Unless required by applicable law or agreed to in writing, software |
1552 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1553 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1554 | - * See the License for the specific language governing permissions and |
1555 | - * limitations under the License. |
1556 | - */ |
1557 | -#ifndef ZORBA_JSONMODULE_JSON_H |
1558 | -#define ZORBA_JSONMODULE_JSON_H |
1559 | - |
1560 | -#include <map> |
1561 | - |
1562 | -#include <zorba/zorba.h> |
1563 | -#include <zorba/iterator.h> |
1564 | -#include <zorba/function.h> |
1565 | -#include <zorba/external_module.h> |
1566 | - |
1567 | -#include "stringiterator_streambuf.h" |
1568 | - |
1569 | -namespace zorba |
1570 | -{ |
1571 | - namespace jsonmodule |
1572 | - { |
1573 | -//***************************************************************************** |
1574 | -//***************************************************************************** |
1575 | - class JsonModule : public ExternalModule |
1576 | - { |
1577 | - private: |
1578 | - static ItemFactory* theFactory; |
1579 | - |
1580 | - protected: |
1581 | - class ltstr |
1582 | - { |
1583 | - public: |
1584 | - bool operator()(const String& s1, const String& s2) const |
1585 | - { |
1586 | - return s1.compare(s2) < 0; |
1587 | - } |
1588 | - }; |
1589 | - |
1590 | - typedef std::map<String, ExternalFunction*, ltstr> FuncMap_t; |
1591 | - |
1592 | - FuncMap_t theFunctions; |
1593 | - |
1594 | - public: |
1595 | - virtual ~JsonModule(); |
1596 | - |
1597 | - virtual String |
1598 | - getURI() const { return "http://www.zorba-xquery.com/modules/converters/json"; } |
1599 | - |
1600 | - virtual ExternalFunction* |
1601 | - getExternalFunction(const String& aLocalname); |
1602 | - |
1603 | - virtual void |
1604 | - destroy(); |
1605 | - |
1606 | - static ItemFactory* |
1607 | - getItemFactory() |
1608 | - { |
1609 | - if(!theFactory) |
1610 | - { |
1611 | - theFactory = Zorba::getInstance(0)->getItemFactory(); |
1612 | - } |
1613 | - return theFactory; |
1614 | - } |
1615 | - }; |
1616 | - |
1617 | -//***************************************************************************** |
1618 | -//***************************************************************************** |
1619 | - class JsonFunction : public ContextualExternalFunction |
1620 | - { |
1621 | - protected: |
1622 | - const JsonModule* theModule; |
1623 | - zorba::String getOptionValue(zorba::Item& aOptionsItem, const char* aOptionName) const; |
1624 | - public: |
1625 | - JsonFunction(const JsonModule* aModule) |
1626 | - : theModule(aModule) {}; |
1627 | - |
1628 | - ~JsonFunction() {}; |
1629 | - |
1630 | - virtual String |
1631 | - getURI() const { return theModule->getURI(); } |
1632 | - |
1633 | - }; |
1634 | - |
1635 | -//***************************************************************************** |
1636 | -//***************************************************************************** |
1637 | - class ParseFunction : public JsonFunction |
1638 | - { |
1639 | - public: |
1640 | - ParseFunction(const JsonModule* aModule); |
1641 | - |
1642 | - virtual String |
1643 | - getLocalName() const { return "parse-internal"; } |
1644 | - |
1645 | - virtual ItemSequence_t |
1646 | - evaluate(const ExternalFunction::Arguments_t& args, |
1647 | - const StaticContext* aSctxCtx, |
1648 | - const DynamicContext* aDynCtx) const; |
1649 | - }; |
1650 | - |
1651 | - class SerializeFunction : public JsonFunction |
1652 | - { |
1653 | - class StringStreamSequence : public ItemSequence, public Iterator, public StringIteratorStreamBuf |
1654 | - { |
1655 | - private: |
1656 | - Iterator_t input_iter; |
1657 | - std::vector<std::vector<String> > headers; |
1658 | - int line_index; |
1659 | - bool has_next; |
1660 | - bool is_open; |
1661 | - int open_count; |
1662 | - |
1663 | - std::vector<String> line; |
1664 | - Item node_item; |
1665 | - public: |
1666 | - std::istream* is; |
1667 | - String theMapping; |
1668 | - ItemFactory* theFactory; |
1669 | - Item streamable_item; |
1670 | - public: |
1671 | - StringStreamSequence(ItemSequence* input); |
1672 | - virtual ~StringStreamSequence() {} |
1673 | - |
1674 | - //for Iterator |
1675 | - virtual void open(); |
1676 | - virtual void close(); |
1677 | - virtual bool isOpen() const; |
1678 | - virtual bool next( Item &result ); |
1679 | - |
1680 | - //for ItemSequence |
1681 | - Iterator_t getIterator() {return this;} |
1682 | - |
1683 | - //for StringIteratorStreamBuf |
1684 | - virtual bool next(std::string &next_string); |
1685 | - virtual bool reset(); |
1686 | - |
1687 | - static void |
1688 | - releaseStream(std::istream* stream) { delete stream; } |
1689 | - |
1690 | - }; |
1691 | - public: |
1692 | - SerializeFunction(const JsonModule* aModule); |
1693 | - |
1694 | - virtual String |
1695 | - getLocalName() const { return "serialize-internal"; } |
1696 | - |
1697 | - virtual ItemSequence_t |
1698 | - evaluate(const ExternalFunction::Arguments_t& args, |
1699 | - const StaticContext* aSctxCtx, |
1700 | - const DynamicContext* aDynCtx) const; |
1701 | - }; |
1702 | - |
1703 | - |
1704 | - |
1705 | - } /* namespace jsonmodule */ |
1706 | -} /* namespace zorba */ |
1707 | - |
1708 | -#endif /* ZORBA_JSONMODULE_JSON_H */ |
1709 | |
1710 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp' |
1711 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp 2011-07-13 01:57:10 +0000 |
1712 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.cpp 1970-01-01 00:00:00 +0000 |
1713 | @@ -1,153 +0,0 @@ |
1714 | -/* |
1715 | - * Copyright 2006-2008 The FLWOR Foundation. |
1716 | - * |
1717 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1718 | - * you may not use this file except in compliance with the License. |
1719 | - * You may obtain a copy of the License at |
1720 | - * |
1721 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1722 | - * |
1723 | - * Unless required by applicable law or agreed to in writing, software |
1724 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1725 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1726 | - * See the License for the specific language governing permissions and |
1727 | - * limitations under the License. |
1728 | - */ |
1729 | - |
1730 | -#include <zorba/diagnostic_list.h> |
1731 | - |
1732 | -#include "stringiterator_streambuf.h" |
1733 | - |
1734 | -using namespace std; |
1735 | -namespace zorba{ |
1736 | - |
1737 | -StringIteratorStreamBuf::StringIteratorStreamBuf() |
1738 | -{ |
1739 | - current_buffer = 0; |
1740 | - last_buffer = 0; |
1741 | - begin_offset = 0; |
1742 | - is_eof = false; |
1743 | -} |
1744 | - |
1745 | -//get next buffer |
1746 | -int StringIteratorStreamBuf::underflow() |
1747 | -{ |
1748 | - if(is_eof) |
1749 | - return EOF; |
1750 | - |
1751 | - begin_offset += buffer[current_buffer].length(); |
1752 | - current_buffer = 1 - current_buffer; |
1753 | - if(last_buffer != current_buffer) |
1754 | - { |
1755 | - buffer[current_buffer].resize(0); |
1756 | - last_buffer = current_buffer; |
1757 | - if(!next(buffer[current_buffer])) |
1758 | - { |
1759 | - //current_buffer = 1 - current_buffer; |
1760 | - buffer[current_buffer].resize(0); |
1761 | - is_eof = true; |
1762 | - return EOF; |
1763 | - } |
1764 | - } |
1765 | - |
1766 | - char *buffstr = (char*)buffer[current_buffer].c_str(); |
1767 | - setg(buffstr, buffstr, buffstr+buffer[current_buffer].length()); |
1768 | - return *buffstr; |
1769 | -} |
1770 | - |
1771 | -//unget char, some special cases |
1772 | -int StringIteratorStreamBuf::pbackfail ( int c ) |
1773 | -{ |
1774 | - if(eback() != gptr()) |
1775 | - { |
1776 | - setg(eback(), gptr()-1, egptr()); |
1777 | - if(c != EOF) |
1778 | - *gptr() = (char)c; |
1779 | - return 1; |
1780 | - } |
1781 | - |
1782 | - //else have to rewind to previous buffer |
1783 | - if(last_buffer != current_buffer) |
1784 | - return EOF; |
1785 | - if(buffer[1-last_buffer].length() == 0) |
1786 | - return EOF; |
1787 | - current_buffer = 1 - current_buffer; |
1788 | - |
1789 | - begin_offset -= buffer[current_buffer].length(); |
1790 | - char *buffstr = (char*)buffer[current_buffer].c_str(); |
1791 | - setg(buffstr, buffstr+buffer[current_buffer].length()-1, buffstr+buffer[current_buffer].length()); |
1792 | - if(c != EOF) |
1793 | - *gptr() = (char)c; |
1794 | - return 1; |
1795 | -} |
1796 | - |
1797 | -//set a new position |
1798 | -//if going too much back, restart the iterator |
1799 | -streampos StringIteratorStreamBuf::seekoff ( streamoff off, ios_base::seekdir way, ios_base::openmode which ) |
1800 | -{ |
1801 | - if(!(which & ios_base::in)) |
1802 | - return -1; |
1803 | - |
1804 | - streampos targetpos; |
1805 | - if(way == ios_base::end) |
1806 | - { |
1807 | - if(off > 0) |
1808 | - return -1; |
1809 | - while(underflow() != EOF); |
1810 | - streampos maxpos = begin_offset + (streamoff)buffer[current_buffer].length(); |
1811 | - targetpos = maxpos + off; |
1812 | - } |
1813 | - else if(way == ios_base::cur) |
1814 | - { |
1815 | - targetpos = begin_offset + (streamoff)(gptr() - eback()) + off; |
1816 | - } |
1817 | - else if(way == ios_base::beg) |
1818 | - { |
1819 | - if(off < 0) |
1820 | - return -1; |
1821 | - targetpos = off; |
1822 | - } |
1823 | - else |
1824 | - return -1; |
1825 | - return seekpos(targetpos, ios_base::in); |
1826 | -} |
1827 | - |
1828 | -//set a new position |
1829 | -//if going too much back, restart the iterator |
1830 | -streampos StringIteratorStreamBuf::seekpos ( streampos sp, ios_base::openmode which ) |
1831 | -{ |
1832 | - if(!(which & ios_base::in)) |
1833 | - return -1; |
1834 | - |
1835 | - if(sp < begin_offset) |
1836 | - { |
1837 | - setg(eback(), eback(), egptr()); |
1838 | - pbackfail(EOF); |
1839 | - if(sp < begin_offset) |
1840 | - { |
1841 | - //restart the iterator |
1842 | - if(!reset()) |
1843 | - return -1; |
1844 | - buffer[0].resize(0); |
1845 | - buffer[1].resize(0); |
1846 | - current_buffer = last_buffer = 0; |
1847 | - begin_offset = 0; |
1848 | - is_eof = false; |
1849 | - setg(NULL, NULL, NULL); |
1850 | - } |
1851 | - } |
1852 | - while(sp >= (begin_offset+(streamoff)buffer[current_buffer].length())) |
1853 | - { |
1854 | - if(underflow() == EOF) |
1855 | - { |
1856 | - if(sp == (begin_offset+(streamoff)buffer[current_buffer].length())) |
1857 | - break; |
1858 | - return -1; |
1859 | - } |
1860 | - } |
1861 | - |
1862 | - setg(eback(), eback() + (streamoff)(sp - begin_offset), egptr()); |
1863 | - return sp; |
1864 | -} |
1865 | - |
1866 | -} |
1867 | |
1868 | === removed file 'src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h' |
1869 | --- src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h 2011-10-06 07:40:17 +0000 |
1870 | +++ src/com/zorba-xquery/www/modules/converters/json.xq.src/stringiterator_streambuf.h 1970-01-01 00:00:00 +0000 |
1871 | @@ -1,49 +0,0 @@ |
1872 | -/* |
1873 | - * Copyright 2006-2008 The FLWOR Foundation. |
1874 | - * |
1875 | - * Licensed under the Apache License, Version 2.0 (the "License"); |
1876 | - * you may not use this file except in compliance with the License. |
1877 | - * You may obtain a copy of the License at |
1878 | - * |
1879 | - * http://www.apache.org/licenses/LICENSE-2.0 |
1880 | - * |
1881 | - * Unless required by applicable law or agreed to in writing, software |
1882 | - * distributed under the License is distributed on an "AS IS" BASIS, |
1883 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1884 | - * See the License for the specific language governing permissions and |
1885 | - * limitations under the License. |
1886 | - */ |
1887 | - |
1888 | -#include <stdio.h> |
1889 | -#include <streambuf> |
1890 | -#include <istream> |
1891 | - |
1892 | -#ifndef STRING_ITERATOR_TO_STREAMBUF_IMPL |
1893 | -#define STRING_ITERATOR_TO_STREAMBUF_IMPL |
1894 | - |
1895 | -namespace zorba{ |
1896 | - |
1897 | -class StringIteratorStreamBuf : public std::streambuf |
1898 | -{ |
1899 | - std::string buffer[2]; |
1900 | - int current_buffer; |
1901 | - int last_buffer; |
1902 | - std::streampos begin_offset; |
1903 | - bool is_eof; |
1904 | -public: |
1905 | - StringIteratorStreamBuf(); |
1906 | - virtual ~StringIteratorStreamBuf() {} |
1907 | - |
1908 | - virtual int underflow ( ); |
1909 | - virtual int pbackfail ( int c = EOF ); |
1910 | - |
1911 | - virtual std::streampos seekoff ( std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ); |
1912 | - virtual std::streampos seekpos ( std::streampos sp, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out ); |
1913 | - |
1914 | -public: |
1915 | - virtual bool next(std::string &next_string) = 0; |
1916 | - virtual bool reset() = 0; |
1917 | -}; |
1918 | - |
1919 | -} |
1920 | -#endif |
1921 | |
1922 | === removed directory 'test_json' |
1923 | === removed directory 'test_json/ExpQueryResults' |
1924 | === removed directory 'test_json/ExpQueryResults/converters' |
1925 | === removed directory 'test_json/ExpQueryResults/converters/jansson' |
1926 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_01.xml.res' |
1927 | --- test_json/ExpQueryResults/converters/jansson/parse_json_01.xml.res 2011-05-31 15:21:09 +0000 |
1928 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_01.xml.res 1970-01-01 00:00:00 +0000 |
1929 | @@ -1,1 +0,0 @@ |
1930 | -<json type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></json> |
1931 | \ No newline at end of file |
1932 | |
1933 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_02.xml.res' |
1934 | --- test_json/ExpQueryResults/converters/jansson/parse_json_02.xml.res 2011-05-31 15:21:09 +0000 |
1935 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_02.xml.res 1970-01-01 00:00:00 +0000 |
1936 | @@ -1,1 +0,0 @@ |
1937 | -<json type="array"><pair type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></pair><pair type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></pair></json> |
1938 | \ No newline at end of file |
1939 | |
1940 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_03.xml.res' |
1941 | --- test_json/ExpQueryResults/converters/jansson/parse_json_03.xml.res 2011-05-31 15:21:09 +0000 |
1942 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_03.xml.res 1970-01-01 00:00:00 +0000 |
1943 | @@ -1,1 +0,0 @@ |
1944 | -<json type="object"><pair name="mdash" type="string">–</pair></json> |
1945 | \ No newline at end of file |
1946 | |
1947 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_06.xml.res' |
1948 | --- test_json/ExpQueryResults/converters/jansson/parse_json_06.xml.res 2011-05-31 15:21:09 +0000 |
1949 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_06.xml.res 1970-01-01 00:00:00 +0000 |
1950 | @@ -1,1 +0,0 @@ |
1951 | -<json type="object"><pair name="web-app" type="string">!_\\"-\\?*.$+</pair></json> |
1952 | \ No newline at end of file |
1953 | |
1954 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_07.xml.res' |
1955 | --- test_json/ExpQueryResults/converters/jansson/parse_json_07.xml.res 2011-05-31 15:21:09 +0000 |
1956 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_07.xml.res 1970-01-01 00:00:00 +0000 |
1957 | @@ -1,1 +0,0 @@ |
1958 | -<json type="object"><pair name="special-numbers" type="object"><pair name="decimal" type="number">2.89</pair><pair name="e" type="number">2e+06</pair><pair name="negative" type="number">-1.89</pair></pair></json> |
1959 | \ No newline at end of file |
1960 | |
1961 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_08.xml.res' |
1962 | --- test_json/ExpQueryResults/converters/jansson/parse_json_08.xml.res 2011-05-31 15:21:09 +0000 |
1963 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_08.xml.res 1970-01-01 00:00:00 +0000 |
1964 | @@ -1,1 +0,0 @@ |
1965 | -<json type="object"><pair name="web-app" type="null"/></json> |
1966 | \ No newline at end of file |
1967 | |
1968 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_09.xml.res' |
1969 | --- test_json/ExpQueryResults/converters/jansson/parse_json_09.xml.res 2011-05-31 15:21:09 +0000 |
1970 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_09.xml.res 1970-01-01 00:00:00 +0000 |
1971 | @@ -1,1 +0,0 @@ |
1972 | -<json type="object"><pair name="bool" type="boolean">true</pair><pair name="numbers" type="array"><item type="number">1</item><item type="number">2</item><item type="number">3</item></pair><pair name="firstName" type="string">John</pair><pair name="state" type="null"/><pair name="address" type="object"><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="delivery" type="object"><pair name="streetAddress" type="string">StreetName</pair><pair name="city" type="string">CityName</pair><pair name="state" type="string">StateName</pair></pair><pair name="state" type="null"/><pair name="postalCode" type="number">10021</pair><pair name="literals" type="array"><item type="boolean">true</item><item type="boolean">false</item><item type="null"/></pair></pair><pair name="strings" type="array"><item type="string">one</item><item type="string">two</item><item type="string">three</item><item type="string">four</item></pair></json> |
1973 | \ No newline at end of file |
1974 | |
1975 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_10.xml.res' |
1976 | --- test_json/ExpQueryResults/converters/jansson/parse_json_10.xml.res 2011-05-31 15:21:09 +0000 |
1977 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_10.xml.res 1970-01-01 00:00:00 +0000 |
1978 | @@ -1,1 +0,0 @@ |
1979 | -<json type="array"><pair type="object"><pair name="lastName" type="string">Smith</pair><pair name="firstName" type="string">John</pair><pair name="address" type="object"><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="city" type="string">New York</pair><pair name="state" type="string">NY</pair><pair name="postalCode" type="number">10021</pair></pair><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair></pair><pair type="object"><pair name="bool" type="boolean">true</pair><pair name="numbers" type="array"><item type="number">1</item><item type="number">2</item><item type="number">3</item></pair><pair name="firstName" type="string">John</pair><pair name="state" type="null"/><pair name="address" type="object"><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="delivery" type="object"><pair name="streetAddress" type="string">StreetName</pair><pair name="city" type="string">CityName</pair><pair name="state" type="string">StateName</pair></pair><pair name="state" type="null"/><pair name="postalCode" type="number">10021</pair><pair name="literals" type="array"><item type="boolean">true</item><item type="boolean">false</item><item type="null"/></pair></pair><pair name="strings" type="array"><item type="string">one</item><item type="string">two</item><item type="string">three</item><item type="string">four</item></pair></pair></json> |
1980 | \ No newline at end of file |
1981 | |
1982 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_11.xml.res' |
1983 | --- test_json/ExpQueryResults/converters/jansson/parse_json_11.xml.res 2011-05-31 15:21:09 +0000 |
1984 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_11.xml.res 1970-01-01 00:00:00 +0000 |
1985 | @@ -1,1 +0,0 @@ |
1986 | -<json type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></json> |
1987 | \ No newline at end of file |
1988 | |
1989 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_12.xml.res' |
1990 | --- test_json/ExpQueryResults/converters/jansson/parse_json_12.xml.res 2011-12-06 14:20:24 +0000 |
1991 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_12.xml.res 1970-01-01 00:00:00 +0000 |
1992 | @@ -1,1 +0,0 @@ |
1993 | -{"html": "<b>bold<\/b>"} |
1994 | |
1995 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_ml_01.xml.res' |
1996 | --- test_json/ExpQueryResults/converters/jansson/parse_json_ml_01.xml.res 2011-05-31 15:21:09 +0000 |
1997 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_ml_01.xml.res 1970-01-01 00:00:00 +0000 |
1998 | @@ -1,1 +0,0 @@ |
1999 | -<ul><li style="color:red">First Item</li><li title="Some hover text." style="color:green">Second Item</li><li><span class="code-example-third">Third</span> Item</li></ul> |
2000 | \ No newline at end of file |
2001 | |
2002 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_ml_02.xml.res' |
2003 | --- test_json/ExpQueryResults/converters/jansson/parse_json_ml_02.xml.res 2011-05-31 15:21:09 +0000 |
2004 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_ml_02.xml.res 1970-01-01 00:00:00 +0000 |
2005 | @@ -1,1 +0,0 @@ |
2006 | -<table class="MyTable" style="background-color:yellow"><tr><td class="MyTD" style="border:1px solid black">#550758</td><td class="MyTD" style="background-color:red">Example text here</td></tr><tr><td class="MyTD" style="border:1px solid black">#993101</td><td class="MyTD" style="background-color:green">127624015</td></tr><tr><td class="MyTD" style="border:1px solid black">#E33D87</td><td class="MyTD" style="background-color:blue"> <span style="background-color:maroon">©</span> </td></tr></table> |
2007 | \ No newline at end of file |
2008 | |
2009 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_ml_05.xml.res' |
2010 | --- test_json/ExpQueryResults/converters/jansson/parse_json_ml_05.xml.res 2011-05-31 15:21:09 +0000 |
2011 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_ml_05.xml.res 1970-01-01 00:00:00 +0000 |
2012 | @@ -1,1 +0,0 @@ |
2013 | -<ul><li style="color:red">First Item</li><li title="Some hover text." style="color:green">Second Item</li><li><span class="code-example-third">Third</span> Item</li></ul> |
2014 | \ No newline at end of file |
2015 | |
2016 | === removed file 'test_json/ExpQueryResults/converters/jansson/parse_json_ml_06.xml.res' |
2017 | --- test_json/ExpQueryResults/converters/jansson/parse_json_ml_06.xml.res 2011-12-06 14:20:24 +0000 |
2018 | +++ test_json/ExpQueryResults/converters/jansson/parse_json_ml_06.xml.res 1970-01-01 00:00:00 +0000 |
2019 | @@ -1,1 +0,0 @@ |
2020 | -<html><b>bold</b></html> |
2021 | |
2022 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res' |
2023 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res 2011-12-07 18:44:46 +0000 |
2024 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_01.xml.res 1970-01-01 00:00:00 +0000 |
2025 | @@ -1,1 +0,0 @@ |
2026 | -{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}} |
2027 | \ No newline at end of file |
2028 | |
2029 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res' |
2030 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res 2011-12-07 18:44:46 +0000 |
2031 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_02.xml.res 1970-01-01 00:00:00 +0000 |
2032 | @@ -1,1 +0,0 @@ |
2033 | -[{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}, {"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}}] |
2034 | \ No newline at end of file |
2035 | |
2036 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res' |
2037 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res 2011-12-07 18:44:46 +0000 |
2038 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_04.xml.res 1970-01-01 00:00:00 +0000 |
2039 | @@ -1,1 +0,0 @@ |
2040 | -{"firstName": "\""} |
2041 | \ No newline at end of file |
2042 | |
2043 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res' |
2044 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res 2011-12-07 18:44:46 +0000 |
2045 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_05.xml.res 1970-01-01 00:00:00 +0000 |
2046 | @@ -1,1 +0,0 @@ |
2047 | -{"name": "\"\\\/\b\f\n\r\t"} |
2048 | \ No newline at end of file |
2049 | |
2050 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res' |
2051 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res 2011-12-07 18:44:46 +0000 |
2052 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_09.xml.res 1970-01-01 00:00:00 +0000 |
2053 | @@ -1,1 +0,0 @@ |
2054 | -{"servlet": [["value1"], "value2"]} |
2055 | \ No newline at end of file |
2056 | |
2057 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_10.xml.res' |
2058 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_10.xml.res 2011-05-31 15:21:09 +0000 |
2059 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_10.xml.res 1970-01-01 00:00:00 +0000 |
2060 | @@ -1,1 +0,0 @@ |
2061 | -{"servlet": [{"name": "value1"}, "value2"] |
2062 | \ No newline at end of file |
2063 | |
2064 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res' |
2065 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res 2011-12-07 18:44:46 +0000 |
2066 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_13.xml.res 1970-01-01 00:00:00 +0000 |
2067 | @@ -1,1 +0,0 @@ |
2068 | -{"servlet": ["value"]} |
2069 | \ No newline at end of file |
2070 | |
2071 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res' |
2072 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res 2011-12-07 18:44:46 +0000 |
2073 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_14.xml.res 1970-01-01 00:00:00 +0000 |
2074 | @@ -1,1 +0,0 @@ |
2075 | -{"servlet": {"name": "value"}} |
2076 | \ No newline at end of file |
2077 | |
2078 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res' |
2079 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res 2011-12-07 18:44:46 +0000 |
2080 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_15.xml.res 1970-01-01 00:00:00 +0000 |
2081 | @@ -1,1 +0,0 @@ |
2082 | -{"servlet": [{}]} |
2083 | \ No newline at end of file |
2084 | |
2085 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res' |
2086 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res 2011-12-07 18:44:46 +0000 |
2087 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_16.xml.res 1970-01-01 00:00:00 +0000 |
2088 | @@ -1,1 +0,0 @@ |
2089 | -{"servlet": [["212 732-1234"]]} |
2090 | \ No newline at end of file |
2091 | |
2092 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_17.xml.res' |
2093 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_17.xml.res 2011-05-31 15:21:09 +0000 |
2094 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_17.xml.res 1970-01-01 00:00:00 +0000 |
2095 | @@ -1,1 +0,0 @@ |
2096 | -{"special-chars": {"backslash": "\\", "formfeed": "\f", "quote": "\\"", "horizontal tab": "\t", "carriage return": "\r", "backspace": "\b", "newline": "\n", "solidus": "\/"}} |
2097 | \ No newline at end of file |
2098 | |
2099 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_18.xml.res' |
2100 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_18.xml.res 2011-12-05 20:05:44 +0000 |
2101 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_18.xml.res 1970-01-01 00:00:00 +0000 |
2102 | @@ -1,1 +0,0 @@ |
2103 | -{"phoneNumbers": ["212 732-1234", "646 123-4567"], "firstName": "John", "lastName": "Smith", "address": {"postalCode": 10021, "city": "New York", "streetAddress": "21 2nd Street", "state": "NY"}} |
2104 | |
2105 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_ml_01.xml.res' |
2106 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_ml_01.xml.res 2011-05-31 15:21:09 +0000 |
2107 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_ml_01.xml.res 1970-01-01 00:00:00 +0000 |
2108 | @@ -1,1 +0,0 @@ |
2109 | -["ul",["li",{"style":"color:red"},"First Item"],["li",{"title":"Some hover text.","style":"color:green"},"Second Item"],["li",["span",{"class":"code-example-third"},"Third"],"Item"]] |
2110 | \ No newline at end of file |
2111 | |
2112 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_ml_02.xml.res' |
2113 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_ml_02.xml.res 2011-05-31 15:21:09 +0000 |
2114 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_ml_02.xml.res 1970-01-01 00:00:00 +0000 |
2115 | @@ -1,1 +0,0 @@ |
2116 | -["table",{"class":"MyTable","style":"background-color:yellow"},["tr",["td",{"class":"MyTD","style":"border:1px solid black"},"#5D28D1"],["td",{"class":"MyTD","style":"background-color:red"},"Example text here"]],["tr",["td",{"class":"MyTD","style":"border:1px solid black"},"#AF44EF"],["td",{"class":"MyTD","style":"background-color:green"},"127310656"]],["tr",["td",{"class":"MyTD","style":"border:1px solid black"},"#AAD034"],["td",{"class":"MyTD","style":"background-color:blue"},"\u00A0",["span",{"style":"background-color:maroon"},"\u00A9"],"\u00A0"]]] |
2117 | \ No newline at end of file |
2118 | |
2119 | === removed file 'test_json/ExpQueryResults/converters/jansson/serialize_json_ml_04.xml.res' |
2120 | --- test_json/ExpQueryResults/converters/jansson/serialize_json_ml_04.xml.res 2011-05-31 15:21:09 +0000 |
2121 | +++ test_json/ExpQueryResults/converters/jansson/serialize_json_ml_04.xml.res 1970-01-01 00:00:00 +0000 |
2122 | @@ -1,1 +0,0 @@ |
2123 | -["ul",["li",{"style":"color:red"},"First Item"],["li",{"title":"Some hover text.","style":"color:green"},"Second Item"],["li",["span",{"class":"code-example-third"},"Third"],"Item"]] |
2124 | \ No newline at end of file |
2125 | |
2126 | === removed directory 'test_json/Queries' |
2127 | === removed directory 'test_json/Queries/converters' |
2128 | === removed directory 'test_json/Queries/converters/jansson' |
2129 | === removed file 'test_json/Queries/converters/jansson/parse_json_01.spec' |
2130 | --- test_json/Queries/converters/jansson/parse_json_01.spec 2011-05-31 15:21:09 +0000 |
2131 | +++ test_json/Queries/converters/jansson/parse_json_01.spec 1970-01-01 00:00:00 +0000 |
2132 | @@ -1,1 +0,0 @@ |
2133 | -Comparison: Ignore |
2134 | \ No newline at end of file |
2135 | |
2136 | === removed file 'test_json/Queries/converters/jansson/parse_json_01.xq' |
2137 | --- test_json/Queries/converters/jansson/parse_json_01.xq 2011-08-07 21:55:48 +0000 |
2138 | +++ test_json/Queries/converters/jansson/parse_json_01.xq 1970-01-01 00:00:00 +0000 |
2139 | @@ -1,22 +0,0 @@ |
2140 | -(: the comparison method for this test is set to Ignore because the order in which the children |
2141 | -are returned in jansson 1.2, 1.3, 2.0 is different:) |
2142 | - |
2143 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2144 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2145 | - |
2146 | -json:parse(('{ |
2147 | - "firstName": "John", |
2148 | - "lastName": "Smith", |
2149 | - "address": { |
2150 | - "streetAddress": "21 2nd Street", |
2151 | - "city": "New York", |
2152 | - "state": "NY", |
2153 | - "postalCode": 10021 |
2154 | - }, |
2155 | - "phoneNumbers": [ |
2156 | - "212 732-1234", |
2157 | - "646 123-4567" |
2158 | - ] |
2159 | - }'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2160 | - <json-param name="mapping" value="simple-json" /> |
2161 | - </options>) |
2162 | |
2163 | === removed file 'test_json/Queries/converters/jansson/parse_json_02.spec' |
2164 | --- test_json/Queries/converters/jansson/parse_json_02.spec 2011-05-31 15:21:09 +0000 |
2165 | +++ test_json/Queries/converters/jansson/parse_json_02.spec 1970-01-01 00:00:00 +0000 |
2166 | @@ -1,1 +0,0 @@ |
2167 | -Comparison: Ignore |
2168 | \ No newline at end of file |
2169 | |
2170 | === removed file 'test_json/Queries/converters/jansson/parse_json_02.xq' |
2171 | --- test_json/Queries/converters/jansson/parse_json_02.xq 2011-08-07 21:55:48 +0000 |
2172 | +++ test_json/Queries/converters/jansson/parse_json_02.xq 1970-01-01 00:00:00 +0000 |
2173 | @@ -1,37 +0,0 @@ |
2174 | -(: the comparison method for this test is set to Ignore because the order in which the children |
2175 | -are returned in jansson 1.2, 1.3, 2.0 is different:) |
2176 | - |
2177 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2178 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2179 | - |
2180 | -json:parse(('[ |
2181 | -{ |
2182 | - "firstName": "John", |
2183 | - "lastName": "Smith", |
2184 | - "address": { |
2185 | - "streetAddress": "21 2nd Street", |
2186 | - "city": "New York", |
2187 | - "state": "NY", |
2188 | - "postalCode": 10021 |
2189 | - }, |
2190 | - "phoneNumbers": [ |
2191 | - "212 732-1234", |
2192 | - "646 123-4567" |
2193 | - ] |
2194 | -}, |
2195 | -{ |
2196 | - "firstName": "John", |
2197 | - "lastName": "Smith", |
2198 | - "address": { |
2199 | - "streetAddress": "21 2nd Street", |
2200 | - "city": "New York", |
2201 | - "state": "NY", |
2202 | - "postalCode": 10021 |
2203 | - }, |
2204 | - "phoneNumbers": [ |
2205 | - "212 732-1234", |
2206 | - "646 123-4567" |
2207 | - ] |
2208 | - }]'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2209 | - <json-param name="mapping" value="simple-json" /> |
2210 | - </options>) |
2211 | |
2212 | === removed file 'test_json/Queries/converters/jansson/parse_json_03.xq' |
2213 | --- test_json/Queries/converters/jansson/parse_json_03.xq 2011-08-07 21:55:48 +0000 |
2214 | +++ test_json/Queries/converters/jansson/parse_json_03.xq 1970-01-01 00:00:00 +0000 |
2215 | @@ -1,8 +0,0 @@ |
2216 | -(: try parsing a Unicode UTF-8 value :) |
2217 | - |
2218 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2219 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2220 | - |
2221 | -json:parse(('{"mdash": "–"}'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2222 | - <json-param name="mapping" value="simple-json" /> |
2223 | - </options>) |
2224 | \ No newline at end of file |
2225 | |
2226 | === removed file 'test_json/Queries/converters/jansson/parse_json_04.spec' |
2227 | --- test_json/Queries/converters/jansson/parse_json_04.spec 2011-08-18 22:09:48 +0000 |
2228 | +++ test_json/Queries/converters/jansson/parse_json_04.spec 1970-01-01 00:00:00 +0000 |
2229 | @@ -1,1 +0,0 @@ |
2230 | -Error: http://www.zorba-xquery.com/modules/converters/json:ParseError |
2231 | |
2232 | === removed file 'test_json/Queries/converters/jansson/parse_json_04.xq' |
2233 | --- test_json/Queries/converters/jansson/parse_json_04.xq 2011-08-07 21:55:48 +0000 |
2234 | +++ test_json/Queries/converters/jansson/parse_json_04.xq 1970-01-01 00:00:00 +0000 |
2235 | @@ -1,8 +0,0 @@ |
2236 | -(: try parsing an empty value :) |
2237 | - |
2238 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2239 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2240 | - |
2241 | -json:parse((<a/>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2242 | - <json-param name="mapping" value="simple-json" /> |
2243 | - </options>) |
2244 | \ No newline at end of file |
2245 | |
2246 | === removed file 'test_json/Queries/converters/jansson/parse_json_05.spec' |
2247 | --- test_json/Queries/converters/jansson/parse_json_05.spec 2011-08-18 22:09:48 +0000 |
2248 | +++ test_json/Queries/converters/jansson/parse_json_05.spec 1970-01-01 00:00:00 +0000 |
2249 | @@ -1,1 +0,0 @@ |
2250 | -Error: http://www.zorba-xquery.com/modules/converters/json:ParseError |
2251 | |
2252 | === removed file 'test_json/Queries/converters/jansson/parse_json_05.xq' |
2253 | --- test_json/Queries/converters/jansson/parse_json_05.xq 2011-08-07 21:55:48 +0000 |
2254 | +++ test_json/Queries/converters/jansson/parse_json_05.xq 1970-01-01 00:00:00 +0000 |
2255 | @@ -1,14 +0,0 @@ |
2256 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2257 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2258 | - |
2259 | -json:parse(('[ "ul", |
2260 | - [ "li", |
2261 | - true], |
2262 | - [ "li", |
2263 | - {"href":"driving.html", "title":"Driving"}, |
2264 | - "Second item"], |
2265 | - [ "li", null], |
2266 | - [ "li", -14e12] |
2267 | -'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2268 | - <json-param name="mapping" value="simple-json" /> |
2269 | - </options>) |
2270 | |
2271 | === removed file 'test_json/Queries/converters/jansson/parse_json_06.xq' |
2272 | --- test_json/Queries/converters/jansson/parse_json_06.xq 2011-08-07 21:55:48 +0000 |
2273 | +++ test_json/Queries/converters/jansson/parse_json_06.xq 1970-01-01 00:00:00 +0000 |
2274 | @@ -1,8 +0,0 @@ |
2275 | -(: json:parse with uncommon characters :) |
2276 | - |
2277 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2278 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2279 | - |
2280 | -json:parse('{ "web-app": "!_\"-\\?*.$+" }',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2281 | - <json-param name="mapping" value="simple-json" /> |
2282 | - </options>) |
2283 | |
2284 | === removed file 'test_json/Queries/converters/jansson/parse_json_07.spec' |
2285 | --- test_json/Queries/converters/jansson/parse_json_07.spec 2011-05-31 15:21:09 +0000 |
2286 | +++ test_json/Queries/converters/jansson/parse_json_07.spec 1970-01-01 00:00:00 +0000 |
2287 | @@ -1,1 +0,0 @@ |
2288 | -Comparison: Ignore |
2289 | \ No newline at end of file |
2290 | |
2291 | === removed file 'test_json/Queries/converters/jansson/parse_json_07.xq' |
2292 | --- test_json/Queries/converters/jansson/parse_json_07.xq 2011-08-07 21:55:48 +0000 |
2293 | +++ test_json/Queries/converters/jansson/parse_json_07.xq 1970-01-01 00:00:00 +0000 |
2294 | @@ -1,13 +0,0 @@ |
2295 | -(: json:parse testing numbers and decimals :) |
2296 | - |
2297 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2298 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2299 | - |
2300 | -json:parse('{ "special-numbers": { |
2301 | - "decimal": 2.89, |
2302 | - "e": 2E+6, |
2303 | - "negative": -1.89 |
2304 | - } |
2305 | - }',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2306 | - <json-param name="mapping" value="simple-json" /> |
2307 | - </options>) |
2308 | |
2309 | === removed file 'test_json/Queries/converters/jansson/parse_json_08.xq' |
2310 | --- test_json/Queries/converters/jansson/parse_json_08.xq 2011-08-07 21:55:48 +0000 |
2311 | +++ test_json/Queries/converters/jansson/parse_json_08.xq 1970-01-01 00:00:00 +0000 |
2312 | @@ -1,8 +0,0 @@ |
2313 | -(: json:parse testing null handling :) |
2314 | - |
2315 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2316 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2317 | - |
2318 | -json:parse('{ "web-app": null }',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2319 | - <json-param name="mapping" value="simple-json" /> |
2320 | - </options>) |
2321 | |
2322 | === removed file 'test_json/Queries/converters/jansson/parse_json_09.spec' |
2323 | --- test_json/Queries/converters/jansson/parse_json_09.spec 2011-05-31 15:21:09 +0000 |
2324 | +++ test_json/Queries/converters/jansson/parse_json_09.spec 1970-01-01 00:00:00 +0000 |
2325 | @@ -1,1 +0,0 @@ |
2326 | -Comparison: Ignore |
2327 | \ No newline at end of file |
2328 | |
2329 | === removed file 'test_json/Queries/converters/jansson/parse_json_09.xq' |
2330 | --- test_json/Queries/converters/jansson/parse_json_09.xq 2011-08-07 21:55:48 +0000 |
2331 | +++ test_json/Queries/converters/jansson/parse_json_09.xq 1970-01-01 00:00:00 +0000 |
2332 | @@ -1,26 +0,0 @@ |
2333 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2334 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2335 | - |
2336 | -json:parse('{ |
2337 | - "firstName": "John", |
2338 | - "state": null, |
2339 | - "bool": true , |
2340 | - "numbers": [1,2,3] , |
2341 | - "address": { |
2342 | - "streetAddress": "21 2nd Street", |
2343 | - "state": null, |
2344 | - "postalCode": 10021 , |
2345 | - "literals": [true,false,null], |
2346 | - "delivery": { |
2347 | - "streetAddress": "StreetName", |
2348 | - "city": "CityName", |
2349 | - "state": "StateName" |
2350 | - }} , |
2351 | - "strings": [ |
2352 | - "one", |
2353 | - "two", |
2354 | - "three", |
2355 | - "four" ] |
2356 | -}',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2357 | - <json-param name="mapping" value="simple-json" /> |
2358 | - </options>) |
2359 | |
2360 | === removed file 'test_json/Queries/converters/jansson/parse_json_10.spec' |
2361 | --- test_json/Queries/converters/jansson/parse_json_10.spec 2011-05-31 15:21:09 +0000 |
2362 | +++ test_json/Queries/converters/jansson/parse_json_10.spec 1970-01-01 00:00:00 +0000 |
2363 | @@ -1,1 +0,0 @@ |
2364 | -Comparison: Ignore |
2365 | \ No newline at end of file |
2366 | |
2367 | === removed file 'test_json/Queries/converters/jansson/parse_json_10.xq' |
2368 | --- test_json/Queries/converters/jansson/parse_json_10.xq 2011-08-07 21:55:48 +0000 |
2369 | +++ test_json/Queries/converters/jansson/parse_json_10.xq 1970-01-01 00:00:00 +0000 |
2370 | @@ -1,40 +0,0 @@ |
2371 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2372 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2373 | - |
2374 | -json:parse('[{ |
2375 | - "firstName": "John", |
2376 | - "lastName": "Smith", |
2377 | - "address": { |
2378 | - "streetAddress": "21 2nd Street", |
2379 | - "city": "New York", |
2380 | - "state": "NY", |
2381 | - "postalCode": 10021 |
2382 | - }, |
2383 | - "phoneNumbers": [ |
2384 | - "212 732-1234", |
2385 | - "646 123-4567" |
2386 | - ] |
2387 | - }, |
2388 | -{ |
2389 | - "firstName": "John", |
2390 | - "state": null, |
2391 | - "bool": true , |
2392 | - "numbers": [1,2,3] , |
2393 | - "address": { |
2394 | - "streetAddress": "21 2nd Street", |
2395 | - "state": null, |
2396 | - "postalCode": 10021 , |
2397 | - "literals": [true,false,null], |
2398 | - "delivery": { |
2399 | - "streetAddress": "StreetName", |
2400 | - "city": "CityName", |
2401 | - "state": "StateName" |
2402 | - }} , |
2403 | - "strings": [ |
2404 | - "one", |
2405 | - "two", |
2406 | - "three", |
2407 | - "four" ] |
2408 | -}]',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2409 | - <json-param name="mapping" value="simple-json" /> |
2410 | - </options>) |
2411 | |
2412 | === removed file 'test_json/Queries/converters/jansson/parse_json_11.spec' |
2413 | --- test_json/Queries/converters/jansson/parse_json_11.spec 2011-05-31 15:21:09 +0000 |
2414 | +++ test_json/Queries/converters/jansson/parse_json_11.spec 1970-01-01 00:00:00 +0000 |
2415 | @@ -1,1 +0,0 @@ |
2416 | -Comparison: Ignore |
2417 | \ No newline at end of file |
2418 | |
2419 | === removed file 'test_json/Queries/converters/jansson/parse_json_11.xq' |
2420 | --- test_json/Queries/converters/jansson/parse_json_11.xq 2011-10-06 07:40:17 +0000 |
2421 | +++ test_json/Queries/converters/jansson/parse_json_11.xq 1970-01-01 00:00:00 +0000 |
2422 | @@ -1,20 +0,0 @@ |
2423 | -(: the comparison method for this test is set to Ignore because the order in which the children |
2424 | -are returned in jansson 1.2, 1.3, 2.0 is different:) |
2425 | - |
2426 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2427 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2428 | - |
2429 | -json:parse(('{ |
2430 | - "firstName": "John", |
2431 | - "lastName": "Smith", |
2432 | - "address": { |
2433 | - "streetAddress": "21 2nd Street", |
2434 | - "city": "New York", |
2435 | - "state": "NY", |
2436 | - "postalCode": 10021 |
2437 | - }, |
2438 | - "phoneNumbers": [ |
2439 | - "212 732-1234", |
2440 | - "646 123-4567" |
2441 | - ] |
2442 | - }')) |
2443 | |
2444 | === removed file 'test_json/Queries/converters/jansson/parse_json_12.xq' |
2445 | --- test_json/Queries/converters/jansson/parse_json_12.xq 2011-12-06 14:20:24 +0000 |
2446 | +++ test_json/Queries/converters/jansson/parse_json_12.xq 1970-01-01 00:00:00 +0000 |
2447 | @@ -1,4 +0,0 @@ |
2448 | -import module namespace json="http://www.zorba-xquery.com/modules/converters/json"; |
2449 | -declare variable $json-value := '{"html":"<b>bold</b>"}'; |
2450 | - |
2451 | -json:serialize(json:parse($json-value)) |
2452 | |
2453 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_01.xq' |
2454 | --- test_json/Queries/converters/jansson/parse_json_ml_01.xq 2011-08-11 20:09:07 +0000 |
2455 | +++ test_json/Queries/converters/jansson/parse_json_ml_01.xq 1970-01-01 00:00:00 +0000 |
2456 | @@ -1,27 +0,0 @@ |
2457 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2458 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2459 | - |
2460 | -json:parse((' |
2461 | -["ul", |
2462 | - ["li", |
2463 | - { "style" : "color:red" }, |
2464 | - "First Item" |
2465 | - ], |
2466 | - ["li", |
2467 | - { |
2468 | - "title" : "Some hover text.", |
2469 | - "style" : "color:green" |
2470 | - }, |
2471 | - "Second Item" |
2472 | - ], |
2473 | - ["li", |
2474 | - ["span", |
2475 | - { "class" : "code-example-third" }, |
2476 | - "Third" |
2477 | - ], |
2478 | - " Item" |
2479 | - ] |
2480 | -]'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" |
2481 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
2482 | - <json-param name="mapping" value="json-ml" type="array"/> |
2483 | - </options>) |
2484 | \ No newline at end of file |
2485 | |
2486 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_02.xq' |
2487 | --- test_json/Queries/converters/jansson/parse_json_ml_02.xq 2011-08-11 20:09:07 +0000 |
2488 | +++ test_json/Queries/converters/jansson/parse_json_ml_02.xq 1970-01-01 00:00:00 +0000 |
2489 | @@ -1,65 +0,0 @@ |
2490 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2491 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2492 | - |
2493 | -json:parse((' |
2494 | -["table", |
2495 | -{ |
2496 | -"class" : "MyTable", |
2497 | -"style" : "background-color:yellow" |
2498 | -}, |
2499 | -["tr", |
2500 | -["td", |
2501 | -{ |
2502 | -"class" : "MyTD", |
2503 | -"style" : "border:1px solid black" |
2504 | -}, |
2505 | -"#550758" |
2506 | -], |
2507 | -["td", |
2508 | -{ |
2509 | -"class" : "MyTD", |
2510 | -"style" : "background-color:red" |
2511 | -}, |
2512 | -"Example text here" |
2513 | -] |
2514 | -], |
2515 | -["tr", |
2516 | -["td", |
2517 | -{ |
2518 | -"class" : "MyTD", |
2519 | -"style" : "border:1px solid black" |
2520 | -}, |
2521 | -"#993101" |
2522 | -], |
2523 | -["td", |
2524 | -{ |
2525 | -"class" : "MyTD", |
2526 | -"style" : "background-color:green" |
2527 | -}, |
2528 | -"127624015" |
2529 | -] |
2530 | -], |
2531 | -["tr", |
2532 | -["td", |
2533 | -{ |
2534 | -"class" : "MyTD", |
2535 | -"style" : "border:1px solid black" |
2536 | -}, |
2537 | -"#E33D87" |
2538 | -], |
2539 | -["td", |
2540 | -{ |
2541 | -"class" : "MyTD", |
2542 | -"style" : "background-color:blue" |
2543 | -}, |
2544 | -"\u00A0", |
2545 | -["span", |
2546 | -{ "style" : "background-color:maroon" }, |
2547 | -"\u00A9" |
2548 | -], |
2549 | -"\u00A0" |
2550 | -] |
2551 | -] |
2552 | -]'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2553 | - <json-param name="mapping" value="json-ml" type="array"/> |
2554 | - </options>) |
2555 | |
2556 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_03.spec' |
2557 | --- test_json/Queries/converters/jansson/parse_json_ml_03.spec 2011-08-18 22:09:48 +0000 |
2558 | +++ test_json/Queries/converters/jansson/parse_json_ml_03.spec 1970-01-01 00:00:00 +0000 |
2559 | @@ -1,1 +0,0 @@ |
2560 | -Error: http://www.zorba-xquery.com/modules/converters/json:ParseError |
2561 | |
2562 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_03.xq' |
2563 | --- test_json/Queries/converters/jansson/parse_json_ml_03.xq 2011-08-11 20:09:07 +0000 |
2564 | +++ test_json/Queries/converters/jansson/parse_json_ml_03.xq 1970-01-01 00:00:00 +0000 |
2565 | @@ -1,8 +0,0 @@ |
2566 | -(: jsonml:parse with empty parameter :) |
2567 | - |
2568 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2569 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2570 | - |
2571 | -json:parse(<a/>,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2572 | - <json-param name="mapping" value="json-ml" type="array"/> |
2573 | - </options>) |
2574 | |
2575 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_04.spec' |
2576 | --- test_json/Queries/converters/jansson/parse_json_ml_04.spec 2011-08-18 22:09:48 +0000 |
2577 | +++ test_json/Queries/converters/jansson/parse_json_ml_04.spec 1970-01-01 00:00:00 +0000 |
2578 | @@ -1,1 +0,0 @@ |
2579 | -Error: http://www.zorba-xquery.com/modules/converters/json:ParseError |
2580 | |
2581 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_04.xq' |
2582 | --- test_json/Queries/converters/jansson/parse_json_ml_04.xq 2011-08-11 20:09:07 +0000 |
2583 | +++ test_json/Queries/converters/jansson/parse_json_ml_04.xq 1970-01-01 00:00:00 +0000 |
2584 | @@ -1,16 +0,0 @@ |
2585 | -(: jsonml:parse with invalid parameter :) |
2586 | - |
2587 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2588 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2589 | - |
2590 | -json:parse(('{ |
2591 | - "firstName": "John", |
2592 | - "lastName": "Smith", |
2593 | - "address": { |
2594 | - "streetAddress": "21 2nd Street", |
2595 | - "city": "New York", |
2596 | - "state": "NY", |
2597 | - "postalCode": 10021 |
2598 | - }'),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2599 | - <json-param name="mapping" value="json-ml" type="array"/> |
2600 | - </options>) |
2601 | |
2602 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_05.xq' |
2603 | --- test_json/Queries/converters/jansson/parse_json_ml_05.xq 2011-10-06 07:40:17 +0000 |
2604 | +++ test_json/Queries/converters/jansson/parse_json_ml_05.xq 1970-01-01 00:00:00 +0000 |
2605 | @@ -1,24 +0,0 @@ |
2606 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2607 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2608 | - |
2609 | -json:parse-ml((' |
2610 | -["ul", |
2611 | - ["li", |
2612 | - { "style" : "color:red" }, |
2613 | - "First Item" |
2614 | - ], |
2615 | - ["li", |
2616 | - { |
2617 | - "title" : "Some hover text.", |
2618 | - "style" : "color:green" |
2619 | - }, |
2620 | - "Second Item" |
2621 | - ], |
2622 | - ["li", |
2623 | - ["span", |
2624 | - { "class" : "code-example-third" }, |
2625 | - "Third" |
2626 | - ], |
2627 | - " Item" |
2628 | - ] |
2629 | -]')) |
2630 | \ No newline at end of file |
2631 | |
2632 | === removed file 'test_json/Queries/converters/jansson/parse_json_ml_06.xq' |
2633 | --- test_json/Queries/converters/jansson/parse_json_ml_06.xq 2011-12-06 14:20:24 +0000 |
2634 | +++ test_json/Queries/converters/jansson/parse_json_ml_06.xq 1970-01-01 00:00:00 +0000 |
2635 | @@ -1,7 +0,0 @@ |
2636 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2637 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2638 | - |
2639 | -json:parse('["html" ,"<b>bold</b>"]',<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" |
2640 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
2641 | - <json-param name="mapping" value="json-ml" type="array"/> |
2642 | - </options>) |
2643 | |
2644 | === removed file 'test_json/Queries/converters/jansson/serialize_json_01.xq' |
2645 | --- test_json/Queries/converters/jansson/serialize_json_01.xq 2011-08-11 20:09:07 +0000 |
2646 | +++ test_json/Queries/converters/jansson/serialize_json_01.xq 1970-01-01 00:00:00 +0000 |
2647 | @@ -1,9 +0,0 @@ |
2648 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2649 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2650 | - |
2651 | - |
2652 | -declare variable $tmp := <json type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></json>; |
2653 | - |
2654 | -json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2655 | - <json-param name="mapping" value="simple-json" type="array"/> |
2656 | - </options>) |
2657 | \ No newline at end of file |
2658 | |
2659 | === removed file 'test_json/Queries/converters/jansson/serialize_json_02.xq' |
2660 | --- test_json/Queries/converters/jansson/serialize_json_02.xq 2011-08-11 20:09:07 +0000 |
2661 | +++ test_json/Queries/converters/jansson/serialize_json_02.xq 1970-01-01 00:00:00 +0000 |
2662 | @@ -1,8 +0,0 @@ |
2663 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2664 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2665 | - |
2666 | -declare variable $tmp := <json type="array"><pair type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></pair><pair type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></pair></json>; |
2667 | - |
2668 | -json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2669 | - <json-param name="mapping" value="simple-json" type="array"/> |
2670 | - </options>) |
2671 | \ No newline at end of file |
2672 | |
2673 | === removed file 'test_json/Queries/converters/jansson/serialize_json_03.spec' |
2674 | --- test_json/Queries/converters/jansson/serialize_json_03.spec 2011-08-18 22:09:48 +0000 |
2675 | +++ test_json/Queries/converters/jansson/serialize_json_03.spec 1970-01-01 00:00:00 +0000 |
2676 | @@ -1,1 +0,0 @@ |
2677 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2678 | |
2679 | === removed file 'test_json/Queries/converters/jansson/serialize_json_03.xq' |
2680 | --- test_json/Queries/converters/jansson/serialize_json_03.xq 2011-08-11 20:09:07 +0000 |
2681 | +++ test_json/Queries/converters/jansson/serialize_json_03.xq 1970-01-01 00:00:00 +0000 |
2682 | @@ -1,8 +0,0 @@ |
2683 | -(: json:serialize called with wrong parameter: comment node:) |
2684 | - |
2685 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2686 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2687 | - |
2688 | -json:serialize((<!--comment-->),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2689 | - <json-param name="mapping" value="simple-json" type="array"/> |
2690 | - </options>) |
2691 | |
2692 | === removed file 'test_json/Queries/converters/jansson/serialize_json_04.xq' |
2693 | --- test_json/Queries/converters/jansson/serialize_json_04.xq 2011-08-07 21:55:48 +0000 |
2694 | +++ test_json/Queries/converters/jansson/serialize_json_04.xq 1970-01-01 00:00:00 +0000 |
2695 | @@ -1,10 +0,0 @@ |
2696 | -(: json:serialize test escaping of double quotes :) |
2697 | - |
2698 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2699 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2700 | - |
2701 | -json:serialize((<json type="object"> |
2702 | - <pair name="firstName" type="string">\"</pair> |
2703 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2704 | - <json-param name="mapping" value="simple-json" /> |
2705 | - </options>) |
2706 | |
2707 | === removed file 'test_json/Queries/converters/jansson/serialize_json_05.xq' |
2708 | --- test_json/Queries/converters/jansson/serialize_json_05.xq 2011-08-07 21:55:48 +0000 |
2709 | +++ test_json/Queries/converters/jansson/serialize_json_05.xq 1970-01-01 00:00:00 +0000 |
2710 | @@ -1,10 +0,0 @@ |
2711 | -(: json:serialize some pitfall characters :) |
2712 | - |
2713 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2714 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2715 | - |
2716 | -json:serialize((<json type="object"> |
2717 | - <pair name="name" type="string">\"\\\/\b\f\n\r\t</pair> |
2718 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2719 | - <json-param name="mapping" value="simple-json" /> |
2720 | - </options>) |
2721 | |
2722 | === removed file 'test_json/Queries/converters/jansson/serialize_json_06.spec' |
2723 | --- test_json/Queries/converters/jansson/serialize_json_06.spec 2011-08-18 22:09:48 +0000 |
2724 | +++ test_json/Queries/converters/jansson/serialize_json_06.spec 1970-01-01 00:00:00 +0000 |
2725 | @@ -1,1 +0,0 @@ |
2726 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2727 | |
2728 | === removed file 'test_json/Queries/converters/jansson/serialize_json_06.xq' |
2729 | --- test_json/Queries/converters/jansson/serialize_json_06.xq 2011-08-07 21:55:48 +0000 |
2730 | +++ test_json/Queries/converters/jansson/serialize_json_06.xq 1970-01-01 00:00:00 +0000 |
2731 | @@ -1,10 +0,0 @@ |
2732 | -(: type value missing :) |
2733 | - |
2734 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2735 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2736 | - |
2737 | -json:serialize((<json type="object"> |
2738 | - <pair name="name" type="">value</pair> |
2739 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2740 | - <json-param name="mapping" value="simple-json" /> |
2741 | - </options>) |
2742 | |
2743 | === removed file 'test_json/Queries/converters/jansson/serialize_json_07.spec' |
2744 | --- test_json/Queries/converters/jansson/serialize_json_07.spec 2011-08-18 22:09:48 +0000 |
2745 | +++ test_json/Queries/converters/jansson/serialize_json_07.spec 1970-01-01 00:00:00 +0000 |
2746 | @@ -1,1 +0,0 @@ |
2747 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2748 | |
2749 | === removed file 'test_json/Queries/converters/jansson/serialize_json_07.xq' |
2750 | --- test_json/Queries/converters/jansson/serialize_json_07.xq 2011-08-07 21:55:48 +0000 |
2751 | +++ test_json/Queries/converters/jansson/serialize_json_07.xq 1970-01-01 00:00:00 +0000 |
2752 | @@ -1,10 +0,0 @@ |
2753 | -(: type value wrong :) |
2754 | - |
2755 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2756 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2757 | - |
2758 | -json:serialize((<json type="object"> |
2759 | - <pair name="name" type="huhu">value</pair> |
2760 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2761 | - <json-param name="mapping" value="simple-json" /> |
2762 | - </options>) |
2763 | |
2764 | === removed file 'test_json/Queries/converters/jansson/serialize_json_08.spec' |
2765 | --- test_json/Queries/converters/jansson/serialize_json_08.spec 2011-08-18 22:09:48 +0000 |
2766 | +++ test_json/Queries/converters/jansson/serialize_json_08.spec 1970-01-01 00:00:00 +0000 |
2767 | @@ -1,1 +0,0 @@ |
2768 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2769 | |
2770 | === removed file 'test_json/Queries/converters/jansson/serialize_json_08.xq' |
2771 | --- test_json/Queries/converters/jansson/serialize_json_08.xq 2011-08-07 21:55:48 +0000 |
2772 | +++ test_json/Queries/converters/jansson/serialize_json_08.xq 1970-01-01 00:00:00 +0000 |
2773 | @@ -1,12 +0,0 @@ |
2774 | -(: wrong value for array :) |
2775 | - |
2776 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2777 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2778 | - |
2779 | -json:serialize((<json type="object"> |
2780 | - <pair name="name" type="array"> |
2781 | - <pair name="wrong" type="string">value</pair> |
2782 | - </pair> |
2783 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2784 | - <json-param name="mapping" value="simple-json" /> |
2785 | - </options>) |
2786 | |
2787 | === removed file 'test_json/Queries/converters/jansson/serialize_json_09.xq' |
2788 | --- test_json/Queries/converters/jansson/serialize_json_09.xq 2011-08-07 21:55:48 +0000 |
2789 | +++ test_json/Queries/converters/jansson/serialize_json_09.xq 1970-01-01 00:00:00 +0000 |
2790 | @@ -1,15 +0,0 @@ |
2791 | -(: valid json generation: array in an array :) |
2792 | - |
2793 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2794 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2795 | - |
2796 | -json:serialize((<json type="object"> |
2797 | - <pair name="servlet" type="array"> |
2798 | - <item type="array"> |
2799 | - <item type="string">value1</item> |
2800 | - </item> |
2801 | - <item type="string">value2</item> |
2802 | - </pair> |
2803 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2804 | - <json-param name="mapping" value="simple-json" /> |
2805 | - </options>) |
2806 | |
2807 | === removed file 'test_json/Queries/converters/jansson/serialize_json_10.spec' |
2808 | --- test_json/Queries/converters/jansson/serialize_json_10.spec 2011-05-31 15:21:09 +0000 |
2809 | +++ test_json/Queries/converters/jansson/serialize_json_10.spec 1970-01-01 00:00:00 +0000 |
2810 | @@ -1,1 +0,0 @@ |
2811 | -Comparison: Ignore |
2812 | \ No newline at end of file |
2813 | |
2814 | === removed file 'test_json/Queries/converters/jansson/serialize_json_10.xq' |
2815 | --- test_json/Queries/converters/jansson/serialize_json_10.xq 2011-08-07 21:55:48 +0000 |
2816 | +++ test_json/Queries/converters/jansson/serialize_json_10.xq 1970-01-01 00:00:00 +0000 |
2817 | @@ -1,15 +0,0 @@ |
2818 | -(: object contained in an array is allowed :) |
2819 | - |
2820 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2821 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2822 | - |
2823 | -json:serialize((<json type="object"> |
2824 | - <pair name="servlet" type="array"> |
2825 | - <item type="object"> |
2826 | - <pair name="name" type="string">value1</pair> |
2827 | - </item> |
2828 | - <item type="string">value2</item> |
2829 | - </pair> |
2830 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2831 | - <json-param name="mapping" value="simple-json" /> |
2832 | - </options>) |
2833 | |
2834 | === removed file 'test_json/Queries/converters/jansson/serialize_json_11.spec' |
2835 | --- test_json/Queries/converters/jansson/serialize_json_11.spec 2011-08-18 22:09:48 +0000 |
2836 | +++ test_json/Queries/converters/jansson/serialize_json_11.spec 1970-01-01 00:00:00 +0000 |
2837 | @@ -1,1 +0,0 @@ |
2838 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2839 | |
2840 | === removed file 'test_json/Queries/converters/jansson/serialize_json_11.xq' |
2841 | --- test_json/Queries/converters/jansson/serialize_json_11.xq 2011-08-07 21:55:48 +0000 |
2842 | +++ test_json/Queries/converters/jansson/serialize_json_11.xq 1970-01-01 00:00:00 +0000 |
2843 | @@ -1,10 +0,0 @@ |
2844 | -(: type attribute missing :) |
2845 | - |
2846 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2847 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2848 | - |
2849 | -json:serialize((<json type="object"> |
2850 | - <pair name="name">value</pair> |
2851 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2852 | - <json-param name="mapping" value="simple-json" /> |
2853 | - </options>) |
2854 | |
2855 | === removed file 'test_json/Queries/converters/jansson/serialize_json_12.spec' |
2856 | --- test_json/Queries/converters/jansson/serialize_json_12.spec 2011-08-18 22:09:48 +0000 |
2857 | +++ test_json/Queries/converters/jansson/serialize_json_12.spec 1970-01-01 00:00:00 +0000 |
2858 | @@ -1,1 +0,0 @@ |
2859 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
2860 | |
2861 | === removed file 'test_json/Queries/converters/jansson/serialize_json_12.xq' |
2862 | --- test_json/Queries/converters/jansson/serialize_json_12.xq 2011-08-07 21:55:48 +0000 |
2863 | +++ test_json/Queries/converters/jansson/serialize_json_12.xq 1970-01-01 00:00:00 +0000 |
2864 | @@ -1,10 +0,0 @@ |
2865 | -(: name attribute missing :) |
2866 | - |
2867 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2868 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2869 | - |
2870 | -json:serialize((<json type="object"> |
2871 | - <pair type="string">value</pair> |
2872 | - </json>),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2873 | - <json-param name="mapping" value="simple-json" /> |
2874 | - </options>) |
2875 | |
2876 | === removed file 'test_json/Queries/converters/jansson/serialize_json_13.xq' |
2877 | --- test_json/Queries/converters/jansson/serialize_json_13.xq 2011-08-07 21:55:48 +0000 |
2878 | +++ test_json/Queries/converters/jansson/serialize_json_13.xq 1970-01-01 00:00:00 +0000 |
2879 | @@ -1,16 +0,0 @@ |
2880 | -(: valid json generation: comments should be ignored :) |
2881 | - |
2882 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2883 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2884 | - |
2885 | -declare variable $local:json := |
2886 | - <json type="object"> |
2887 | - <pair name="servlet" type="array"> |
2888 | - <!--comment--> |
2889 | - <item type="string">value</item> |
2890 | - </pair> |
2891 | - </json>; |
2892 | - |
2893 | -json:serialize($local:json,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2894 | - <json-param name="mapping" value="simple-json" /> |
2895 | - </options>) |
2896 | |
2897 | === removed file 'test_json/Queries/converters/jansson/serialize_json_14.xq' |
2898 | --- test_json/Queries/converters/jansson/serialize_json_14.xq 2011-08-07 21:55:48 +0000 |
2899 | +++ test_json/Queries/converters/jansson/serialize_json_14.xq 1970-01-01 00:00:00 +0000 |
2900 | @@ -1,16 +0,0 @@ |
2901 | -(: valid json generation: comments should be ignored :) |
2902 | - |
2903 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2904 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2905 | - |
2906 | -declare variable $local:json := |
2907 | - <json type="object"> |
2908 | - <pair name="servlet" type="object"> |
2909 | - <!--comment--> |
2910 | - <pair name="name" type="string">value</pair> |
2911 | - </pair> |
2912 | - </json>; |
2913 | - |
2914 | -json:serialize($local:json,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2915 | - <json-param name="mapping" value="simple-json" /> |
2916 | - </options>) |
2917 | |
2918 | === removed file 'test_json/Queries/converters/jansson/serialize_json_15.xq' |
2919 | --- test_json/Queries/converters/jansson/serialize_json_15.xq 2011-08-07 21:55:48 +0000 |
2920 | +++ test_json/Queries/converters/jansson/serialize_json_15.xq 1970-01-01 00:00:00 +0000 |
2921 | @@ -1,13 +0,0 @@ |
2922 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2923 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2924 | - |
2925 | -declare variable $local:json :=<json type="object"> |
2926 | - <pair name="servlet" type="array"> |
2927 | - <item type="object"> |
2928 | - </item> |
2929 | - </pair> |
2930 | -</json>; |
2931 | - |
2932 | -json:serialize($local:json,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2933 | - <json-param name="mapping" value="simple-json" /> |
2934 | - </options>) |
2935 | |
2936 | === removed file 'test_json/Queries/converters/jansson/serialize_json_16.xq' |
2937 | --- test_json/Queries/converters/jansson/serialize_json_16.xq 2011-08-07 21:55:48 +0000 |
2938 | +++ test_json/Queries/converters/jansson/serialize_json_16.xq 1970-01-01 00:00:00 +0000 |
2939 | @@ -1,14 +0,0 @@ |
2940 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2941 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2942 | - |
2943 | -declare variable $local:json :=<json type="object"> |
2944 | - <pair name="servlet" type="array"> |
2945 | - <item type="array"> |
2946 | - <item type='string'>212 732-1234</item> |
2947 | - </item> |
2948 | - </pair> |
2949 | -</json>; |
2950 | - |
2951 | -json:serialize($local:json,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2952 | - <json-param name="mapping" value="simple-json" /> |
2953 | - </options>) |
2954 | |
2955 | === removed file 'test_json/Queries/converters/jansson/serialize_json_17.spec' |
2956 | --- test_json/Queries/converters/jansson/serialize_json_17.spec 2011-05-31 15:21:09 +0000 |
2957 | +++ test_json/Queries/converters/jansson/serialize_json_17.spec 1970-01-01 00:00:00 +0000 |
2958 | @@ -1,1 +0,0 @@ |
2959 | -Comparison: Ignore |
2960 | \ No newline at end of file |
2961 | |
2962 | === removed file 'test_json/Queries/converters/jansson/serialize_json_17.xq' |
2963 | --- test_json/Queries/converters/jansson/serialize_json_17.xq 2011-08-07 21:55:48 +0000 |
2964 | +++ test_json/Queries/converters/jansson/serialize_json_17.xq 1970-01-01 00:00:00 +0000 |
2965 | @@ -1,23 +0,0 @@ |
2966 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2967 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2968 | - |
2969 | - |
2970 | -declare variable $local:json := |
2971 | - '{ "special-chars": { |
2972 | - "quote": "\"", |
2973 | - "backslash": "\\", |
2974 | - "backspace": "\b", |
2975 | - "formfeed": "\f", |
2976 | - "newline": "\n", |
2977 | - "carriage return": "\r", |
2978 | - "horizontal tab": "\t", |
2979 | - "solidus": "\/" |
2980 | - } |
2981 | - }'; |
2982 | - |
2983 | -json:serialize((json:parse(($local:json),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2984 | - <json-param name="mapping" value="simple-json" /> |
2985 | - </options>)),<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
2986 | - <json-param name="mapping" value="simple-json" /> |
2987 | - </options>) |
2988 | - |
2989 | |
2990 | === removed file 'test_json/Queries/converters/jansson/serialize_json_18.xq' |
2991 | --- test_json/Queries/converters/jansson/serialize_json_18.xq 2011-10-06 07:40:17 +0000 |
2992 | +++ test_json/Queries/converters/jansson/serialize_json_18.xq 1970-01-01 00:00:00 +0000 |
2993 | @@ -1,7 +0,0 @@ |
2994 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
2995 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
2996 | - |
2997 | - |
2998 | -declare variable $tmp := <json type="object"><pair name="phoneNumbers" type="array"><item type="string">212 732-1234</item><item type="string">646 123-4567</item></pair><pair name="firstName" type="string">John</pair><pair name="lastName" type="string">Smith</pair><pair name="address" type="object"><pair name="postalCode" type="number">10021</pair><pair name="city" type="string">New York</pair><pair name="streetAddress" type="string">21 2nd Street</pair><pair name="state" type="string">NY</pair></pair></json>; |
2999 | - |
3000 | -json:serialize($tmp) |
3001 | \ No newline at end of file |
3002 | |
3003 | === removed file 'test_json/Queries/converters/jansson/serialize_json_ml_01.xq' |
3004 | --- test_json/Queries/converters/jansson/serialize_json_ml_01.xq 2011-08-11 20:09:07 +0000 |
3005 | +++ test_json/Queries/converters/jansson/serialize_json_ml_01.xq 1970-01-01 00:00:00 +0000 |
3006 | @@ -1,12 +0,0 @@ |
3007 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
3008 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
3009 | - |
3010 | -declare variable $tmp :=<ul> |
3011 | - <li style="color:red">First Item</li> |
3012 | - <li title="Some hover text." style="color:green">Second Item</li> |
3013 | - <li><span class="code-example-third">Third</span>Item</li> |
3014 | -</ul>; |
3015 | - |
3016 | -json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
3017 | - <json-param name="mapping" value="json-ml" type="array"/> |
3018 | - </options>) |
3019 | \ No newline at end of file |
3020 | |
3021 | === removed file 'test_json/Queries/converters/jansson/serialize_json_ml_02.xq' |
3022 | --- test_json/Queries/converters/jansson/serialize_json_ml_02.xq 2011-08-11 20:09:07 +0000 |
3023 | +++ test_json/Queries/converters/jansson/serialize_json_ml_02.xq 1970-01-01 00:00:00 +0000 |
3024 | @@ -1,21 +0,0 @@ |
3025 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
3026 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
3027 | - |
3028 | -declare variable $tmp :=<table class="MyTable" style="background-color:yellow"> |
3029 | -<tr> |
3030 | -<td class="MyTD" style="border:1px solid black">#5D28D1</td> |
3031 | -<td class="MyTD" style="background-color:red">Example text here</td> |
3032 | -</tr> |
3033 | -<tr> |
3034 | -<td class="MyTD" style="border:1px solid black">#AF44EF</td> |
3035 | -<td class="MyTD" style="background-color:green">127310656</td> |
3036 | -</tr> |
3037 | -<tr> |
3038 | -<td class="MyTD" style="border:1px solid black">#AAD034</td> |
3039 | -<td class="MyTD" style="background-color:blue">\u00A0<span style="background-color:maroon">\u00A9</span>\u00A0</td> |
3040 | -</tr> |
3041 | -</table>; |
3042 | - |
3043 | -json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
3044 | - <json-param name="mapping" value="json-ml" type="array"/> |
3045 | - </options>) |
3046 | \ No newline at end of file |
3047 | |
3048 | === removed file 'test_json/Queries/converters/jansson/serialize_json_ml_03.spec' |
3049 | --- test_json/Queries/converters/jansson/serialize_json_ml_03.spec 2011-08-18 22:09:48 +0000 |
3050 | +++ test_json/Queries/converters/jansson/serialize_json_ml_03.spec 1970-01-01 00:00:00 +0000 |
3051 | @@ -1,1 +0,0 @@ |
3052 | -Error: http://www.zorba-xquery.com/modules/converters/json:InvalidXDM |
3053 | |
3054 | === removed file 'test_json/Queries/converters/jansson/serialize_json_ml_03.xq' |
3055 | --- test_json/Queries/converters/jansson/serialize_json_ml_03.xq 2011-08-11 20:09:07 +0000 |
3056 | +++ test_json/Queries/converters/jansson/serialize_json_ml_03.xq 1970-01-01 00:00:00 +0000 |
3057 | @@ -1,8 +0,0 @@ |
3058 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
3059 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
3060 | - |
3061 | -declare variable $tmp :=<!--comment-->; |
3062 | - |
3063 | -json:serialize($tmp,<options xmlns="http://www.zorba-xquery.com/modules/converters/json-options" > |
3064 | - <json-param name="mapping" value="json-ml" type="array"/> |
3065 | - </options>) |
3066 | \ No newline at end of file |
3067 | |
3068 | === removed file 'test_json/Queries/converters/jansson/serialize_json_ml_04.xq' |
3069 | --- test_json/Queries/converters/jansson/serialize_json_ml_04.xq 2011-10-06 07:40:17 +0000 |
3070 | +++ test_json/Queries/converters/jansson/serialize_json_ml_04.xq 1970-01-01 00:00:00 +0000 |
3071 | @@ -1,10 +0,0 @@ |
3072 | -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; |
3073 | -import schema namespace html-options="http://www.zorba-xquery.com/modules/converters/json-options"; |
3074 | - |
3075 | -declare variable $tmp :=<ul> |
3076 | - <li style="color:red">First Item</li> |
3077 | - <li title="Some hover text." style="color:green">Second Item</li> |
3078 | - <li><span class="code-example-third">Third</span>Item</li> |
3079 | -</ul>; |
3080 | - |
3081 | -json:serialize-ml($tmp) |
3082 | \ No newline at end of file |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ remove_ old_json- 2012-01- 23T19-46- 43.722Z/ log.html
Log at: http://