zorba-coders team mailing list archive
-
zorba-coders team
-
Mailing list archive
-
Message #24138
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
Chris Hillery has proposed merging lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba.
Requested reviews:
Zorba Coders (zorba-coders)
Related bugs:
Bug #1189786 in Zorba: "Update core module "json""
https://bugs.launchpad.net/zorba/+bug/1189786
For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bug-1189786-json-update/+merge/174085
--
https://code.launchpad.net/~zorba-coders/zorba/bug-1189786-json-update/+merge/174085
Your team Zorba Coders is requested to review the proposed merge of lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba.
=== modified file 'modules/CMakeLists.txt'
--- modules/CMakeLists.txt 2013-07-04 22:17:19 +0000
+++ modules/CMakeLists.txt 2013-07-11 00:48:40 +0000
@@ -18,7 +18,11 @@
ADD_SUBDIRECTORY(xqxq)
ADD_SUBDIRECTORY(w3c)
ADD_SUBDIRECTORY(full-text)
+<<<<<<< TREE
ADD_SUBDIRECTORY(nodes)
+=======
+ADD_SUBDIRECTORY(json)
+>>>>>>> MERGE-SOURCE
# Add external module projects - any subdirectories of a directory
# named "zorba_modules" as a sibling to the main Zorba source
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-04 22:17:19 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-07-11 00:48:40 +0000
@@ -88,10 +88,6 @@
# Subdirectories
DECLARE_ZORBA_MODULE(FILE converters/base64.xq VERSION 2.0
URI "http://www.zorba-xquery.com/modules/converters/base64";)
-DECLARE_ZORBA_MODULE(FILE converters/json.xq VERSION 2.0
- URI "http://www.zorba-xquery.com/modules/converters/json";)
-DECLARE_ZORBA_SCHEMA(FILE converters/json-options.xsd
- URI "http://www.zorba-xquery.com/modules/converters/json-options";)
DECLARE_ZORBA_MODULE(FILE introspection/sctx.xq VERSION 2.0
URI "http://www.zorba-xquery.com/modules/introspection/sctx";)
=== removed file 'modules/com/zorba-xquery/www/modules/converters/json-options.xsd'
--- modules/com/zorba-xquery/www/modules/converters/json-options.xsd 2013-02-07 17:24:36 +0000
+++ modules/com/zorba-xquery/www/modules/converters/json-options.xsd 1970-01-01 00:00:00 +0000
@@ -1,60 +0,0 @@
-<!--
- ! Copyright 2006-2008 The FLWOR Foundation.
- !
- ! Licensed under the Apache License, Version 2.0 (the "License");
- ! you may not use this file except in compliance with the License.
- ! You may obtain a copy of the License at
- !
- ! http://www.apache.org/licenses/LICENSE-2.0
- !
- ! Unless required by applicable law or agreed to in writing, software
- ! distributed under the License is distributed on an "AS IS" BASIS,
- ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ! See the License for the specific language governing permissions and
- ! limitations under the License.
--->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
- xmlns:json="http://www.zorba-xquery.com/modules/converters/json-options";
- targetNamespace="http://www.zorba-xquery.com/modules/converters/json-options";
- elementFormDefault="qualified"
- attributeFormDefault="unqualified">
-
- <xs:element name="options">
- <xs:complexType>
- <xs:all>
-
- <xs:element name="json-format" minOccurs="1" maxOccurs="1">
- <xs:complexType>
- <xs:attribute name="value" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="Snelson"/>
- <xs:enumeration value="JsonML-array"/>
- <!-- <xs:enumeration value="JsonML-object"/> -->
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
-
- <xs:element name="whitespace" minOccurs="0" maxOccurs="1">
- <xs:complexType>
- <xs:attribute name="value" use="required">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="none"/>
- <xs:enumeration value="some"/>
- <xs:enumeration value="indent"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
-
- </xs:all>
- </xs:complexType>
- </xs:element>
-</xs:schema>
-
-<!-- vim:set et sw=2 ts=2: -->
=== added directory 'modules/json'
=== added file 'modules/json/CMakeLists.txt'
--- modules/json/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ modules/json/CMakeLists.txt 2013-07-11 00:48:40 +0000
@@ -0,0 +1,16 @@
+# Copyright 2013 The FLWOR Foundation.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+DECLARE_ZORBA_MODULE(FILE json-xml.xq VERSION 1.0
+ URI "http://zorba.io/modules/json-xml";)
=== renamed file 'modules/com/zorba-xquery/www/modules/converters/json.xq' => 'modules/json/json-xml.xq'
--- modules/com/zorba-xquery/www/modules/converters/json.xq 2013-06-25 03:55:20 +0000
+++ modules/json/json-xml.xq 2013-07-11 00:48:40 +0000
@@ -18,7 +18,7 @@
(:~
: Using this module, you can parse JSON data into XML, manipulate it like any
- : other XML data using XQuery, and serialize the result back as JSON.
+ : other XML data using XQuery, and serialize the result back as JSON.<p/>
:
: There are many ways to represent JSON data in XML, some loss-less ("round
: tripable") and some lossy ("one way"). Loss-less representations preserve
@@ -93,34 +93,25 @@
: @author Paul J. Lucas
: @project Zorba/Data Converters/JSON
:)
-module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
-
-import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
-
-import schema namespace json-options =
- "http://www.zorba-xquery.com/modules/converters/json-options";;
+module namespace jx = "http://zorba.io/modules/json-xml";;
declare namespace an = "http://www.zorba-xquery.com/annotations";;
declare namespace err = "http://www.w3.org/2005/xqt-errors";;
declare namespace zerr = "http://zorba.io/modules/zorba-errors";;
declare namespace ver = "http://www.zorba-xquery.com/options/versioning";;
-declare option ver:module-version "2.0";
+declare option ver:module-version "1.0";
(:~
: Parses JSON data from a string and returns an XDM instance using one of the
- : representations described above.
+ : representations described above.<p/>
:
: @param $json The JSON data to parse.
: @param $options The parsing options, for example:
: <pre>
- : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options">
- : <json-format value="JsonML-array"/>
- : </options>
+ : { "json-format" : "JsonML-array" }
: </pre>
: @return said XDM instance.
- : @error err:XQDY0027 if $options can not be validated against the
- : json-options schema.
: @error zerr:ZJPE0001 if $json contains an illegal JSON character.
: @error zerr:ZJPE0002 if $json contains an illegal Unicode code-point.
: @error zerr:ZJPE0003 if $json contains an illegal JSON character escape.
@@ -131,21 +122,17 @@
: @error zerr:ZJPE0008 if $json contains an illegal QName.
: @example test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq
:)
-declare function json:parse(
+declare function jx:json-to-xml(
$json as xs:string?,
- $options as element(json-options:options)
+ $options as object()
) as element(*,xs:untyped)*
{
- let $validated-options := if ( schema:is-validated( $options ) ) then
- $options
- else
- validate { $options }
- return json:parse-internal( $json, $validated-options )
+ jx:json-to-xml-internal( $json, $options )
};
(:~
: Parses JSON data from a string and returns an XDM instance using the Snelson
- : representation described above.
+ : representation described above.<p/>
:
: @param $json The JSON data to parse.
: @return said XDM instance.
@@ -159,36 +146,25 @@
: @error zerr:ZJPE0008 if $json contains an illegal QName.
: @example test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq
:)
-declare function json:parse(
+declare function jx:json-to-xml(
$json as xs:string?
) as element(*,xs:untyped)*
{
- json:parse-internal(
- $json,
- validate {
- <options
- xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="Snelson"/>
- </options>
- }
+ jx:json-to-xml-internal(
+ $json, { "json-format" : "Snelson" }
)
};
(:~
: Serializes an XDM into JSON using one of the representations described
- : above.
+ : above.<p/>
:
: @param $xml The XDM to serialize.
: @param $options The serializing options, for example:
: <pre>
- : <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options">
- : <json-format value="JsonML-array"/>
- : <whitespace value="indent"/>
- : </options>
+ : { "json-format" : "JsonML-array", "whitespace" : "indent" }
: </pre>
: @return a JSON string.
- : @error err:XQDY0027 if $options can not be validated against the
- : json-options schema.
: @error zerr:ZJSE0001 if $xml is not a document or element node.
: @error zerr:ZJSE0002 if $xml contains an element that is missing a required
: attribute.
@@ -201,21 +177,17 @@
: @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type.
: @example test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq
:)
-declare function json:serialize(
+declare function jx:xml-to-json(
$xml as item()*,
- $options as element(json-options:options)
+ $options as object()
) as xs:string
{
- let $validated-options := if ( schema:is-validated( $options ) ) then
- $options
- else
- validate { $options }
- return json:serialize-internal( $xml, $validated-options )
+ jx:xml-to-json-internal( $xml, $options )
};
(:~
: Serializes an XDM into JSON using one of the representations described
- : above.
+ : above.<p/>
:
: @param $xml The XDM to serialize.
: @return a JSON string.
@@ -231,28 +203,21 @@
: @error zerr:ZJSE0008 if $xml contains an illegal value for a JSON type.
: @example test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq
:)
-declare function json:serialize(
+declare function jx:xml-to-json(
$xml as item()*
) as xs:string
{
- json:serialize-internal($xml,
- validate {
- <options
- xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="Snelson"/>
- </options>
- }
- )
+ jx:xml-to-json-internal($xml, { "json-format" : "Snelson" })
};
(:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::)
-declare %private function json:parse-internal(
+declare %private function jx:json-to-xml-internal(
$json as xs:string?,
$options as item()?
) as element()* external;
-declare %an:streamable %private function json:serialize-internal(
+declare %an:streamable %private function jx:xml-to-json-internal(
$xml as item()*,
$options as item()?
) as xs:string external;
=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp 2013-07-04 22:17:19 +0000
+++ src/context/static_context.cpp 2013-07-11 00:48:40 +0000
@@ -355,7 +355,7 @@
const char*
static_context::ZORBA_JSON_FN_NS =
-"http://www.zorba-xquery.com/modules/converters/json";;
+"http://zorba.io/modules/json-xml";;
const char*
static_context::ZORBA_NODEREF_FN_NS =
=== modified file 'src/functions/pregenerated/func_json.cpp'
--- src/functions/pregenerated/func_json.cpp 2013-03-05 23:11:50 +0000
+++ src/functions/pregenerated/func_json.cpp 2013-07-11 00:48:40 +0000
@@ -31,24 +31,24 @@
-PlanIter_t fn_zorba_json_parse_internal::codegen(
+PlanIter_t fn_zorba_json_json_to_xml_internal::codegen(
CompilerCB*,
static_context* sctx,
const QueryLoc& loc,
std::vector<PlanIter_t>& argv,
expr& ann) const
{
- return new JSONParseInternal(sctx, loc, argv);
+ return new JSONtoXMLInternal(sctx, loc, argv);
}
-PlanIter_t fn_zorba_json_serialize_internal::codegen(
+PlanIter_t fn_zorba_json_xml_to_json_internal::codegen(
CompilerCB*,
static_context* sctx,
const QueryLoc& loc,
std::vector<PlanIter_t>& argv,
expr& ann) const
{
- return new JSONSerializeInternal(sctx, loc, argv);
+ return new XMLtoJSONInternal(sctx, loc, argv);
}
void populate_context_json(static_context* sctx)
@@ -56,12 +56,12 @@
{
- DECL_WITH_KIND(sctx, fn_zorba_json_parse_internal,
- (createQName("http://www.zorba-xquery.com/modules/converters/json","","parse-internal";),
+ DECL_WITH_KIND(sctx, fn_zorba_json_json_to_xml_internal,
+ (createQName("http://zorba.io/modules/json-xml","","json-to-xml-internal";),
GENV_TYPESYSTEM.STRING_TYPE_ONE,
GENV_TYPESYSTEM.ITEM_TYPE_QUESTION,
GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
- FunctionConsts::FN_ZORBA_JSON_PARSE_INTERNAL_2);
+ FunctionConsts::FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2);
}
@@ -69,12 +69,12 @@
{
- DECL_WITH_KIND(sctx, fn_zorba_json_serialize_internal,
- (createQName("http://www.zorba-xquery.com/modules/converters/json","","serialize-internal";),
+ DECL_WITH_KIND(sctx, fn_zorba_json_xml_to_json_internal,
+ (createQName("http://zorba.io/modules/json-xml","","xml-to-json-internal";),
GENV_TYPESYSTEM.ITEM_TYPE_STAR,
GENV_TYPESYSTEM.ITEM_TYPE_QUESTION,
GENV_TYPESYSTEM.STRING_TYPE_ONE),
- FunctionConsts::FN_ZORBA_JSON_SERIALIZE_INTERNAL_2);
+ FunctionConsts::FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2);
}
=== modified file 'src/functions/pregenerated/func_json.h'
--- src/functions/pregenerated/func_json.h 2013-03-05 23:11:50 +0000
+++ src/functions/pregenerated/func_json.h 2013-07-11 00:48:40 +0000
@@ -38,11 +38,11 @@
-//fn-zorba-json:parse-internal
-class fn_zorba_json_parse_internal : public function
+//fn-zorba-json:json-to-xml-internal
+class fn_zorba_json_json_to_xml_internal : public function
{
public:
- fn_zorba_json_parse_internal(const signature& sig, FunctionConsts::FunctionKind kind)
+ fn_zorba_json_json_to_xml_internal(const signature& sig, FunctionConsts::FunctionKind kind)
:
function(sig, kind)
{
@@ -53,11 +53,11 @@
};
-//fn-zorba-json:serialize-internal
-class fn_zorba_json_serialize_internal : public function
+//fn-zorba-json:xml-to-json-internal
+class fn_zorba_json_xml_to_json_internal : public function
{
public:
- fn_zorba_json_serialize_internal(const signature& sig, FunctionConsts::FunctionKind kind)
+ fn_zorba_json_xml_to_json_internal(const signature& sig, FunctionConsts::FunctionKind kind)
:
function(sig, kind)
{
=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h 2013-06-26 00:10:23 +0000
+++ src/functions/pregenerated/function_enum.h 2013-07-11 00:48:40 +0000
@@ -250,8 +250,8 @@
FN_ZORBA_INTROSPECT_SCTX_OPTION_1,
FN_ZORBA_INTROSPECT_SCTX_FUNCTION_ANNOTATIONS_2,
FN_ZORBA_ITEM_SIZE_1,
- FN_ZORBA_JSON_PARSE_INTERNAL_2,
- FN_ZORBA_JSON_SERIALIZE_INTERNAL_2,
+ FN_ZORBA_JSON_JSON_TO_XML_INTERNAL_2,
+ FN_ZORBA_JSON_XML_TO_JSON_INTERNAL_2,
FN_JSONIQ_DECODE_FROM_ROUNDTRIP_1,
FN_JSONIQ_DECODE_FROM_ROUNDTRIP_2,
FN_JSONIQ_ENCODE_FOR_ROUNDTRIP_1,
=== modified file 'src/runtime/json/json_impl.cpp'
--- src/runtime/json/json_impl.cpp 2013-06-01 00:30:39 +0000
+++ src/runtime/json/json_impl.cpp 2013-07-11 00:48:40 +0000
@@ -39,27 +39,22 @@
typedef map<zstring,zstring> options_type;
-static void get_options( store::Item_t const &options_element,
+static void get_options( store::Item_t const &options_object,
options_type *options ) {
- ZORBA_ASSERT( options_element->getNodeKind() ==
- store::StoreConsts::elementNode );
- store::Iterator_t i = options_element->getChildren();
+ ZORBA_ASSERT( options_object->getKind() == store::Item::OBJECT );
+ store::Iterator_t i = options_object->getObjectKeys();
i->open();
- store::Item_t option_item;
- while ( i->next( option_item ) ) {
- if ( option_item->getNodeKind() == store::StoreConsts::elementNode ) {
- zstring const name( option_item->getNodeName()->getStringValue() );
- zstring value;
- get_attribute_value( option_item, "value", &value );
- (*options)[ name ] = value;
- }
+ store::Item_t option_key;
+ while ( i->next( option_key ) ) {
+ zstring const name( option_key->getStringValue() );
+ (*options)[ name ] = options_object->getObjectValue(option_key)->getStringValue();
}
i->close();
}
///////////////////////////////////////////////////////////////////////////////
-bool JSONParseInternal::nextImpl( store::Item_t& result,
+bool JSONtoXMLInternal::nextImpl( store::Item_t& result,
PlanState &planState ) const {
store::Item_t cur_item;
options_type options;
@@ -190,7 +185,7 @@
///////////////////////////////////////////////////////////////////////////////
-bool JSONSerializeInternal::nextImpl( store::Item_t& result,
+bool XMLtoJSONInternal::nextImpl( store::Item_t& result,
PlanState &planState ) const {
store::Item_t cur_item;
options_type options;
=== modified file 'src/runtime/json/pregenerated/json.cpp'
--- src/runtime/json/pregenerated/json.cpp 2013-03-05 23:11:50 +0000
+++ src/runtime/json/pregenerated/json.cpp 2013-07-11 00:48:40 +0000
@@ -32,60 +32,60 @@
namespace zorba {
-// <JSONParseInternal>
-SERIALIZABLE_CLASS_VERSIONS(JSONParseInternal)
-
-void JSONParseInternal::serialize(::zorba::serialization::Archiver& ar)
-{
- serialize_baseclass(ar,
- (NaryBaseIterator<JSONParseInternal, PlanIteratorState>*)this);
-}
-
-
-void JSONParseInternal::accept(PlanIterVisitor& v) const
-{
- v.beginVisit(*this);
-
- std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
- std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
- for ( ; lIter != lEnd; ++lIter ){
- (*lIter)->accept(v);
- }
-
- v.endVisit(*this);
-}
-
-JSONParseInternal::~JSONParseInternal() {}
-
-// </JSONParseInternal>
-
-
-// <JSONSerializeInternal>
-SERIALIZABLE_CLASS_VERSIONS(JSONSerializeInternal)
-
-void JSONSerializeInternal::serialize(::zorba::serialization::Archiver& ar)
-{
- serialize_baseclass(ar,
- (NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>*)this);
-}
-
-
-void JSONSerializeInternal::accept(PlanIterVisitor& v) const
-{
- v.beginVisit(*this);
-
- std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
- std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
- for ( ; lIter != lEnd; ++lIter ){
- (*lIter)->accept(v);
- }
-
- v.endVisit(*this);
-}
-
-JSONSerializeInternal::~JSONSerializeInternal() {}
-
-// </JSONSerializeInternal>
+// <JSONtoXMLInternal>
+SERIALIZABLE_CLASS_VERSIONS(JSONtoXMLInternal)
+
+void JSONtoXMLInternal::serialize(::zorba::serialization::Archiver& ar)
+{
+ serialize_baseclass(ar,
+ (NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>*)this);
+}
+
+
+void JSONtoXMLInternal::accept(PlanIterVisitor& v) const
+{
+ v.beginVisit(*this);
+
+ std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+ std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+ for ( ; lIter != lEnd; ++lIter ){
+ (*lIter)->accept(v);
+ }
+
+ v.endVisit(*this);
+}
+
+JSONtoXMLInternal::~JSONtoXMLInternal() {}
+
+// </JSONtoXMLInternal>
+
+
+// <XMLtoJSONInternal>
+SERIALIZABLE_CLASS_VERSIONS(XMLtoJSONInternal)
+
+void XMLtoJSONInternal::serialize(::zorba::serialization::Archiver& ar)
+{
+ serialize_baseclass(ar,
+ (NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>*)this);
+}
+
+
+void XMLtoJSONInternal::accept(PlanIterVisitor& v) const
+{
+ v.beginVisit(*this);
+
+ std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+ std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+ for ( ; lIter != lEnd; ++lIter ){
+ (*lIter)->accept(v);
+ }
+
+ v.endVisit(*this);
+}
+
+XMLtoJSONInternal::~XMLtoJSONInternal() {}
+
+// </XMLtoJSONInternal>
=== modified file 'src/runtime/json/pregenerated/json.h'
--- src/runtime/json/pregenerated/json.h 2013-03-05 23:11:50 +0000
+++ src/runtime/json/pregenerated/json.h 2013-07-11 00:48:40 +0000
@@ -39,25 +39,25 @@
*
* Author: Zorba Team
*/
-class JSONParseInternal : public NaryBaseIterator<JSONParseInternal, PlanIteratorState>
+class JSONtoXMLInternal : public NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>
{
public:
- SERIALIZABLE_CLASS(JSONParseInternal);
+ SERIALIZABLE_CLASS(JSONtoXMLInternal);
- SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONParseInternal,
- NaryBaseIterator<JSONParseInternal, PlanIteratorState>);
+ SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONtoXMLInternal,
+ NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>);
void serialize( ::zorba::serialization::Archiver& ar);
- JSONParseInternal(
+ JSONtoXMLInternal(
static_context* sctx,
const QueryLoc& loc,
std::vector<PlanIter_t>& children)
:
- NaryBaseIterator<JSONParseInternal, PlanIteratorState>(sctx, loc, children)
+ NaryBaseIterator<JSONtoXMLInternal, PlanIteratorState>(sctx, loc, children)
{}
- virtual ~JSONParseInternal();
+ virtual ~JSONtoXMLInternal();
void accept(PlanIterVisitor& v) const;
@@ -71,25 +71,25 @@
*
* Author: Zorba Team
*/
-class JSONSerializeInternal : public NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>
+class XMLtoJSONInternal : public NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>
{
public:
- SERIALIZABLE_CLASS(JSONSerializeInternal);
+ SERIALIZABLE_CLASS(XMLtoJSONInternal);
- SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONSerializeInternal,
- NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>);
+ SERIALIZABLE_CLASS_CONSTRUCTOR2T(XMLtoJSONInternal,
+ NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>);
void serialize( ::zorba::serialization::Archiver& ar);
- JSONSerializeInternal(
+ XMLtoJSONInternal(
static_context* sctx,
const QueryLoc& loc,
std::vector<PlanIter_t>& children)
:
- NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>(sctx, loc, children)
+ NaryBaseIterator<XMLtoJSONInternal, PlanIteratorState>(sctx, loc, children)
{}
- virtual ~JSONSerializeInternal();
+ virtual ~XMLtoJSONInternal();
void accept(PlanIterVisitor& v) const;
=== modified file 'src/runtime/pregenerated/iterator_enum.h'
--- src/runtime/pregenerated/iterator_enum.h 2013-06-08 05:33:57 +0000
+++ src/runtime/pregenerated/iterator_enum.h 2013-07-11 00:48:40 +0000
@@ -162,8 +162,8 @@
TYPE_OptionIterator,
TYPE_FunctionAnnotationsIterator,
TYPE_MemSizeIterator,
- TYPE_JSONParseInternal,
- TYPE_JSONSerializeInternal,
+ TYPE_JSONtoXMLInternal,
+ TYPE_XMLtoJSONInternal,
TYPE_JSONDecodeFromRoundtripIterator,
TYPE_JSONEncodeForRoundtripIterator,
TYPE_JSONParseIterator,
=== modified file 'src/runtime/spec/json/json.xml'
--- src/runtime/spec/json/json.xml 2011-12-16 19:36:24 +0000
+++ src/runtime/spec/json/json.xml 2013-07-11 00:48:40 +0000
@@ -13,14 +13,14 @@
/*******************************************************************************
*******************************************************************************/
-->
-<zorba:iterator name="JSONParseInternal" arity="nary">
+<zorba:iterator name="JSONtoXMLInternal" arity="nary">
<zorba:description author="Zorba Team">
function for parsing strings into json-xdm
</zorba:description>
<zorba:function isDeterministic="true">
- <zorba:signature localname="parse-internal" prefix="fn-zorba-json">
+ <zorba:signature localname="json-to-xml-internal" prefix="fn-zorba-json">
<zorba:param>xs:string</zorba:param>
<zorba:param>item()?</zorba:param>
<zorba:output>element()*</zorba:output>
@@ -33,14 +33,14 @@
/*******************************************************************************
*******************************************************************************/
-->
-<zorba:iterator name="JSONSerializeInternal" arity="nary">
+<zorba:iterator name="XMLtoJSONInternal" arity="nary">
<zorba:description author="Zorba Team">
Function to serialize json/jsonml xdm to string
</zorba:description>
<zorba:function isDeterministic="true">
- <zorba:signature localname="serialize-internal" prefix="fn-zorba-json">
+ <zorba:signature localname="xml-to-json-internal" prefix="fn-zorba-json">
<zorba:param>item()*</zorba:param>
<zorba:param>item()?</zorba:param>
<zorba:output>xs:string</zorba:output>
=== modified file 'src/runtime/spec/mappings.xml'
--- src/runtime/spec/mappings.xml 2013-07-04 22:17:19 +0000
+++ src/runtime/spec/mappings.xml 2013-07-11 00:48:40 +0000
@@ -118,7 +118,7 @@
define="ZORBA_URI_FN_NS"
prefix="fn-zorba-uri"/>
- <zorba:namespace uri="http://www.zorba-xquery.com/modules/converters/json";
+ <zorba:namespace uri="http://zorba.io/modules/json-xml";
define="ZORBA_JSON_FN_NS"
prefix="fn-zorba-json"/>
=== modified file 'src/runtime/visitors/pregenerated/planiter_visitor.h'
--- src/runtime/visitors/pregenerated/planiter_visitor.h 2013-06-08 05:33:57 +0000
+++ src/runtime/visitors/pregenerated/planiter_visitor.h 2013-07-11 00:48:40 +0000
@@ -330,9 +330,9 @@
class MemSizeIterator;
- class JSONParseInternal;
+ class JSONtoXMLInternal;
- class JSONSerializeInternal;
+ class XMLtoJSONInternal;
class JSONDecodeFromRoundtripIterator;
@@ -1207,11 +1207,11 @@
virtual void beginVisit ( const MemSizeIterator& ) = 0;
virtual void endVisit ( const MemSizeIterator& ) = 0;
- virtual void beginVisit ( const JSONParseInternal& ) = 0;
- virtual void endVisit ( const JSONParseInternal& ) = 0;
+ virtual void beginVisit ( const JSONtoXMLInternal& ) = 0;
+ virtual void endVisit ( const JSONtoXMLInternal& ) = 0;
- virtual void beginVisit ( const JSONSerializeInternal& ) = 0;
- virtual void endVisit ( const JSONSerializeInternal& ) = 0;
+ virtual void beginVisit ( const XMLtoJSONInternal& ) = 0;
+ virtual void endVisit ( const XMLtoJSONInternal& ) = 0;
virtual void beginVisit ( const JSONDecodeFromRoundtripIterator& ) = 0;
virtual void endVisit ( const JSONDecodeFromRoundtripIterator& ) = 0;
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.cpp'
--- src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-06-08 05:33:57 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-07-11 00:48:40 +0000
@@ -1985,32 +1985,32 @@
// </MemSizeIterator>
-// <JSONParseInternal>
-void PrinterVisitor::beginVisit ( const JSONParseInternal& a) {
- thePrinter.startBeginVisit("JSONParseInternal", ++theId);
- printCommons( &a, theId );
- thePrinter.endBeginVisit( theId );
-}
-
-void PrinterVisitor::endVisit ( const JSONParseInternal& ) {
- thePrinter.startEndVisit();
- thePrinter.endEndVisit();
-}
-// </JSONParseInternal>
-
-
-// <JSONSerializeInternal>
-void PrinterVisitor::beginVisit ( const JSONSerializeInternal& a) {
- thePrinter.startBeginVisit("JSONSerializeInternal", ++theId);
- printCommons( &a, theId );
- thePrinter.endBeginVisit( theId );
-}
-
-void PrinterVisitor::endVisit ( const JSONSerializeInternal& ) {
- thePrinter.startEndVisit();
- thePrinter.endEndVisit();
-}
-// </JSONSerializeInternal>
+// <JSONtoXMLInternal>
+void PrinterVisitor::beginVisit ( const JSONtoXMLInternal& a) {
+ thePrinter.startBeginVisit("JSONtoXMLInternal", ++theId);
+ printCommons( &a, theId );
+ thePrinter.endBeginVisit( theId );
+}
+
+void PrinterVisitor::endVisit ( const JSONtoXMLInternal& ) {
+ thePrinter.startEndVisit();
+ thePrinter.endEndVisit();
+}
+// </JSONtoXMLInternal>
+
+
+// <XMLtoJSONInternal>
+void PrinterVisitor::beginVisit ( const XMLtoJSONInternal& a) {
+ thePrinter.startBeginVisit("XMLtoJSONInternal", ++theId);
+ printCommons( &a, theId );
+ thePrinter.endBeginVisit( theId );
+}
+
+void PrinterVisitor::endVisit ( const XMLtoJSONInternal& ) {
+ thePrinter.startEndVisit();
+ thePrinter.endEndVisit();
+}
+// </XMLtoJSONInternal>
// <JSONDecodeFromRoundtripIterator>
=== modified file 'src/runtime/visitors/pregenerated/printer_visitor.h'
--- src/runtime/visitors/pregenerated/printer_visitor.h 2013-06-08 05:33:57 +0000
+++ src/runtime/visitors/pregenerated/printer_visitor.h 2013-07-11 00:48:40 +0000
@@ -505,11 +505,11 @@
void beginVisit( const MemSizeIterator& );
void endVisit ( const MemSizeIterator& );
- void beginVisit( const JSONParseInternal& );
- void endVisit ( const JSONParseInternal& );
+ void beginVisit( const JSONtoXMLInternal& );
+ void endVisit ( const JSONtoXMLInternal& );
- void beginVisit( const JSONSerializeInternal& );
- void endVisit ( const JSONSerializeInternal& );
+ void beginVisit( const XMLtoJSONInternal& );
+ void endVisit ( const XMLtoJSONInternal& );
void beginVisit( const JSONDecodeFromRoundtripIterator& );
void endVisit ( const JSONDecodeFromRoundtripIterator& );
=== modified file 'test/rbkt/Queries/zorba/error/data-location-json-2.xq'
--- test/rbkt/Queries/zorba/error/data-location-json-2.xq 2013-06-25 03:55:20 +0000
+++ test/rbkt/Queries/zorba/error/data-location-json-2.xq 2013-07-11 00:48:40 +0000
@@ -1,5 +1,5 @@
import module namespace file = "http://expath.org/ns/file";;
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace json = "http://zorba.io/modules/json-xml";;
declare namespace zerr = "http://zorba.io/modules/zorba-errors";;
let $file := "$RBKT_SRC_DIR/Queries/zorba/error/data-location.json"
=== modified file 'test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq'
--- test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq 2012-01-24 01:20:54 +0000
+++ test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq 2013-07-11 00:48:40 +0000
@@ -1,10 +1,6 @@
(: try parsing a valid JSON string with invalid JSON option parameter :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
-
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="array"/>
- </options>
-
-return json:parse('{}',$options)
+import module namespace jx = "http://zorba.io/modules/json-xml";;
+
+let $options := { "json-format" : "array" }
+return jx:json-to-xml('{}',$options)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2013-07-11 00:48:40 +0000
@@ -1,10 +1,7 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ "li", "list item" ]'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '
[ "ul",
@@ -6,10 +6,7 @@
[ "li", "list item 2" ]
]
'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '
[ "file",
@@ -10,10 +10,7 @@
}
]
'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '
[ "ul",
@@ -21,10 +21,7 @@
" Item"
]
]'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '["table",
{
@@ -59,10 +59,7 @@
]
]
]'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2013-07-11 00:48:40 +0000
@@ -1,11 +1,8 @@
(: try parsing an empty value :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( <a/>, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( <a/>, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq 2012-05-13 15:33:57 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-07.xq 2013-07-11 00:48:40 +0000
@@ -1,14 +1,11 @@
-import module namespace json =
- "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx =
+ "http://zorba.io/modules/json-xml";;
-let $opt :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
+let $options := { "json-format" : "JsonML-array" }
let $json :=
'{
"args": [ "<div><span>foo:</span> parse</div>" ]
}'
-return json:parse( $json, $opt )
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq 2013-04-02 02:48:56 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-08.xq 2013-07-11 00:48:40 +0000
@@ -1,11 +1,8 @@
-import module namespace json =
- "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx =
+ "http://zorba.io/modules/json-xml";;
-let $opt :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
+let $options := { "json-format" : "JsonML-array" }
let $json := '[ { "x" : "x" } ]'
-return json:parse( $json, $opt )
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '
[ "person",
@@ -15,10 +15,7 @@
]
]
'
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:parse( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:json-to-xml( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2013-07-11 00:48:40 +0000
@@ -1,11 +1,8 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<li>list item</li>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2013-07-11 00:48:40 +0000
@@ -1,14 +1,11 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<ul>
<li>list item 1</li>
<li>list item 2</li>
</ul>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2013-07-11 00:48:40 +0000
@@ -1,11 +1,8 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<file dir="/tmp" name="foo" size="1234" modified="2006-12-31T23:59"/>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<person created="2006-11-11T19:23" modified="2006-12-31T23:59">
@@ -11,11 +11,7 @@
<postalCode>98765-4321</postalCode>
</address>
</person>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- <whitespace value="indent"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array", "whitespace" : "indent" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<person created="2006-11-11T19:23" modified="2006-12-31T23:59">
@@ -11,10 +11,7 @@
<postalCode>98765-4321</postalCode>
</address>
</person>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq'
--- test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<person created="2006-11-11T19:23" modified="2006-12-31T23:59">
@@ -11,11 +11,7 @@
<postalCode>98765-4321</postalCode>
</address>
</person>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="JsonML-array"/>
- <whitespace value="some"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "JsonML-array", "whitespace" : "some" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq 2012-01-23 23:22:52 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-json:parse('[ "ul",
+jx:json-to-xml('[ "ul",
[ "li", true],
[ "li",
{"href":"driving.html", "title":"Driving"},
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ true ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ false ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ null ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ 1 ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '[ 1, 2 ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq 2012-01-26 01:35:11 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
(: parse a JSON array composed of 2 JSON objects :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-json:parse( '[ { "key1": "value1" }, { "key2": "value2" } ]' )
+jx:json-to-xml( '[ { "key1": "value1" }, { "key2": "value2" } ]' )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
(: parse an JSON array composed of 2 JSON arrays :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-json:parse( '[ [ 11, 12 ], [ 21, 22 ] ]' )
+jx:json-to-xml( '[ [ 11, 12 ], [ 21, 22 ] ]' )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq 2012-02-08 01:15:26 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
-import module namespace json =
- "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx =
+ "http://zorba.io/modules/json-xml";;
let $json := '[ 1, { "foo": "bar" } ]'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
(: try parsing an empty value :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-json:parse( <a/> )
+jx:json-to-xml( <a/> )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '
{
@@ -16,6 +16,6 @@
]
}
'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 2013-07-11 00:48:40 +0000
@@ -1,8 +1,8 @@
-(: json:parse testing numbers :)
-
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
-
-json:parse( '{
+(: jx:json-to-xml testing numbers :)
+
+import module namespace jx = "http://zorba.io/modules/json-xml";;
+
+jx:json-to-xml( '{
"decimal": 2.89,
"e": 2E+6,
"negative": -1.89
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '{ "a" : 1 }'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := '{ "a" : 1, "b" : 2 }'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq 2012-02-08 15:45:53 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
-import module namespace json =
- "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx =
+ "http://zorba.io/modules/json-xml";;
let $json := '{ "k1" : [ { "k2" : "v2" }, null ] }'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq 2012-02-13 17:25:08 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq 2013-07-11 00:48:40 +0000
@@ -1,5 +1,5 @@
-import module namespace json =
- "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx =
+ "http://zorba.io/modules/json-xml";;
let $json := '
{
@@ -7,6 +7,6 @@
"key2": "value"
}
'
-return json:parse( $json )
+return jx:json-to-xml( $json )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
-(: json:parse testing null as a key value :)
-
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
-
-json:parse( '{ "a" : null }' )
+(: jx:json-to-xml testing null as a key value :)
+
+import module namespace jx = "http://zorba.io/modules/json-xml";;
+
+jx:json-to-xml( '{ "a" : null }' )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2013-07-11 00:48:40 +0000
@@ -1,10 +1,10 @@
-import module namespace json="http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx="http://zorba.io/modules/json-xml";;
declare variable $json-element :=
<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery"; type="object">
<pair name="html" type="string"><b>bold</b></pair>
</json>;
-json:parse( json:serialize( $json-element ) )
+jx:json-to-xml( jx:xml-to-json( $json-element ) )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
-(: json:parse with uncommon characters :)
-
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
-
-json:parse( '{ "web-app" : "!_\"-\\?*.$+" }' )
+(: jx:json-to-xml with uncommon characters :)
+
+import module namespace jx = "http://zorba.io/modules/json-xml";;
+
+jx:json-to-xml( '{ "web-app" : "!_\"-\\?*.$+" }' )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 2013-07-11 00:48:40 +0000
@@ -1,5 +1,5 @@
(: try parsing a Unicode UTF-8 value :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
-json:parse( '{ "mdash": "–" }' )
+jx:json-to-xml( '{ "mdash": "–" }' )
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="boolean">true</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="boolean">false</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="null"/>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="number">1</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2013-07-11 00:48:40 +0000
@@ -1,10 +1,10 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="number">1</item>
<item type="number">2</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<foo type="boolean">true</foo>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="boolean">foo</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item>false</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="bool">false</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
hello
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<item type="boolean"><foo/></item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2013-07-11 00:48:40 +0000
@@ -1,12 +1,12 @@
(: valid json generation: comments should be ignored :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="array">
<!--comment-->
<item type="boolean">true</item>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json := <!--comment-->
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
@@ -15,11 +15,7 @@
<item type="string">646 123-4567</item>
</pair>
</json>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="Snelson"/>
- <whitespace value="indent"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "Snelson", "whitespace" : "indent" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery"; type="object">
<pair name="a" type="nothing">a</pair>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
@@ -15,6 +15,6 @@
<item type="string">646 123-4567</item>
</pair>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
<pair name="a" type="number">1</pair>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2013-07-11 00:48:40 +0000
@@ -1,10 +1,10 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
<pair name="a" type="number">1</pair>
<pair name="b" type="number">2</pair>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2013-07-11 00:48:40 +0000
@@ -1,6 +1,6 @@
(: valid json generation: comments should be ignored :)
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
@@ -8,6 +8,6 @@
<pair name="a" type="number">1</pair>
<!--comment-->
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2013-07-11 00:48:40 +0000
@@ -1,7 +1,7 @@
-import module namespace json="http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx="http://zorba.io/modules/json-xml";;
declare variable $json-value := '{ "key" : "value" }';
-json:serialize( json:parse( $json-value ) )
+jx:xml-to-json( jx:json-to-xml( $json-value ) )
(: vim:se et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2013-07-11 00:48:40 +0000
@@ -1,4 +1,4 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json type="object">
@@ -15,11 +15,7 @@
<item type="string">646 123-4567</item>
</pair>
</json>
-let $options :=
- <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options";>
- <json-format value="Snelson"/>
- <whitespace value="some"/>
- </options>
-return json:serialize( $json, $options )
+let $options := { "json-format" : "Snelson", "whitespace" : "some" }
+return jx:xml-to-json( $json, $options )
(: vim:set et sw=2 ts=2: :)
=== modified file 'test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq'
--- test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2013-02-07 17:24:36 +0000
+++ test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2013-07-11 00:48:40 +0000
@@ -1,9 +1,9 @@
-import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";;
+import module namespace jx = "http://zorba.io/modules/json-xml";;
let $json :=
<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery"; type="object">
<pair name="a">a</pair>
</json>
-return json:serialize( $json )
+return jx:xml-to-json( $json )
(: vim:set et sw=2 ts=2: :)
Follow ups
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: noreply, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Paul J. Lucas, 2013-07-11
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Paul J. Lucas, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Chris Hillery, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
Re: [Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Chris Hillery, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11
-
[Merge] lp:~zorba-coders/zorba/bug-1189786-json-update into lp:zorba
From: Zorba Build Bot, 2013-07-11