Merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba

Proposed by Till Westmann
Status: Merged
Approved by: Till Westmann
Approved revision: 11071
Merged at revision: 11079
Proposed branch: lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip
Merge into: lp:zorba
Diff against target: 372 lines (+196/-47)
13 files modified
src/runtime/json/jsoniq_functions_impl.cpp (+150/-41)
src/runtime/json/pregenerated/jsoniq_functions.h (+2/-0)
src/runtime/spec/json/jsoniq_functions.xml (+12/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res (+2/-0)
test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq (+15/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip
Reviewer Review Type Date Requested Status
Ghislain Fourny Approve
Matthias Brantner Approve
Review via email: mp+126590@code.launchpad.net

Commit message

use XDM node kinds in encode-for-roundtrip

Description of the change

use XDM node kinds in encode-for-roundtrip

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job
  bug-1055608-node-kinds-for-roundtrip-2012-09-27T02-17-43.713Z is finished.
  The final status was:

  3 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1055608-node-kinds-for-roundtrip-2012-09-27T03-36-39.765Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Pending.

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1055608-node-kinds-for-roundtrip-2012-09-27T05-41-43.261Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Pending.

Revision history for this message
Matthias Brantner (matthias-brantner) :
review: Approve
Revision history for this message
Ghislain Fourny (gislenius) wrote :

Looks good, but there is a typo :-) (s/instauction/instruction).

review: Approve
Revision history for this message
Till Westmann (tillw) wrote :

> Looks good, but there is a typo :-) (s/instauction/instruction).

fixed. Thanks!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job
  bug-1055608-node-kinds-for-roundtrip-2012-10-01T16-23-54.914Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job
  bug-1055608-node-kinds-for-roundtrip-2012-10-01T17-12-56.025Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job
  bug-1055608-node-kinds-for-roundtrip-2012-10-01T21-33-01.981Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1055608-node-kinds-for-roundtrip-2012-10-02T11-24-30.174Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/runtime/json/jsoniq_functions_impl.cpp'
--- src/runtime/json/jsoniq_functions_impl.cpp 2012-09-24 17:11:12 +0000
+++ src/runtime/json/jsoniq_functions_impl.cpp 2012-10-01 16:22:23 +0000
@@ -1,12 +1,12 @@
1/*1/*
2 * Copyright 2006-2008 The FLWOR Foundation.2 * Copyright 2006-2008 The FLWOR Foundation.
3 * 3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at6 * You may obtain a copy of the License at
7 * 7 *
8 * http://www.apache.org/licenses/LICENSE-2.08 * http://www.apache.org/licenses/LICENSE-2.0
9 * 9 *
10 * Unless required by applicable law or agreed to in writing, software10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -67,6 +67,72 @@
67const char * OPTIONS_KEY_PREFIX = "prefix";67const char * OPTIONS_KEY_PREFIX = "prefix";
68const char * OPTIONS_KEY_SER_PARAMS = "serialization-parameters";68const char * OPTIONS_KEY_SER_PARAMS = "serialization-parameters";
6969
70const char * SEQTYPE_ANYNODE = "node()";
71const char * SEQTYPE_COMMENT = "comment()";
72const char * SEQTYPE_DOCUMENT = "document-node()";
73const char * SEQTYPE_ELEMENT = "element()";
74const char * SEQTYPE_PROCINST = "processing-instruction()";
75const char * SEQTYPE_TEXT = "text()";
76
77const char * kind2str(const store::NodeKind& aKind)
78{
79 // we do not support attibutes and namespaces as they cannot be serialized
80 switch (aKind)
81 {
82 case store::StoreConsts::anyNode: return SEQTYPE_ANYNODE;
83 case store::StoreConsts::commentNode: return SEQTYPE_COMMENT;
84 case store::StoreConsts::documentNode: return SEQTYPE_DOCUMENT;
85 case store::StoreConsts::elementNode: return SEQTYPE_ELEMENT;
86 case store::StoreConsts::piNode: return SEQTYPE_PROCINST;
87 case store::StoreConsts::textNode: return SEQTYPE_TEXT;
88 default: return "";
89 }
90}
91
92bool str2kind(const zstring& aString, store::NodeKind& aKind)
93{
94 switch(aString.at(0))
95 {
96 case 'c':
97 if (aString == SEQTYPE_COMMENT)
98 {
99 aKind = store::StoreConsts::commentNode;
100 return true;
101 }
102 break;
103 case 'd':
104 if (aString == SEQTYPE_DOCUMENT)
105 {
106 aKind = store::StoreConsts::documentNode;
107 return true;
108 }
109 break;
110 case 'e':
111 case 'n': // "node()" maps to element for backwards compatibility
112 if (aString == SEQTYPE_ELEMENT || aString == SEQTYPE_ANYNODE)
113 {
114 aKind = store::StoreConsts::elementNode;
115 return true;
116 }
117 break;
118 case 'p':
119 if (aString == SEQTYPE_PROCINST)
120 {
121 aKind = store::StoreConsts::piNode;
122 return true;
123 }
124 break;
125 case 't':
126 if (aString == SEQTYPE_TEXT)
127 {
128 aKind = store::StoreConsts::textNode;
129 return true;
130 }
131 break;
132 }
133 return false;
134}
135
70/*******************************************************************************136/*******************************************************************************
71 json:decode-from-roundtrip($items as json-item()*,137 json:decode-from-roundtrip($items as json-item()*,
72 $options as object()) as structured-item()*138 $options as object()) as structured-item()*
@@ -97,6 +163,82 @@
97 }163 }
98}164}
99165
166void
167JSONDecodeFromRoundtripIterator::extractChildOfKind(
168 const store::Item_t& aParent,
169 const store::NodeKind& aKind,
170 store::Item_t& aChild)
171{
172 store::Iterator_t lIt = aParent->getChildren();
173 bool lFound = false;
174 lIt->open();
175 while (! lFound && lIt->next(aChild))
176 {
177 lFound = aChild->getNodeKind() == aKind;
178 }
179 lIt->close();
180 ZORBA_ASSERT(lFound);
181}
182
183bool
184JSONDecodeFromRoundtripIterator::decodeNode(
185 const store::Item_t& aSerializedNode,
186 const store::NodeKind& aKind,
187 store::Item_t& aResult) const
188{
189 store::LoadProperties lProperties;
190 lProperties.setStoreDocument(false);
191 store::Item_t lDoc;
192 zstring lXmlString;
193 switch (aKind)
194 {
195 case store::StoreConsts::commentNode:
196 case store::StoreConsts::piNode:
197 case store::StoreConsts::textNode:
198 {
199 // we have to wrap these 3 node kinds, so we cannot care about streams
200 aSerializedNode->getStringValue2(lXmlString);
201 lXmlString = "<a>" + lXmlString + "</a>";
202 std::istringstream lStream(lXmlString.c_str());
203 lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties);
204 }
205 break;
206 default:
207 if (aSerializedNode->isStreamable())
208 {
209 lDoc = GENV.getStore().loadDocument(
210 "", "", aSerializedNode->getStream(), lProperties);
211 }
212 else
213 {
214 aSerializedNode->getStringValue2(lXmlString);
215 std::istringstream lStream(lXmlString.c_str());
216 lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties);
217 }
218 break;
219 }
220 if (aKind == store::StoreConsts::documentNode)
221 {
222 aResult = lDoc;
223 }
224 else
225 {
226 store::Item_t lRootElem;
227 extractChildOfKind(lDoc, store::StoreConsts::elementNode, lRootElem);
228 if (aKind == store::StoreConsts::elementNode)
229 {
230 // if we needed an element we're done
231 aResult = lRootElem;
232 }
233 else
234 {
235 // otherwise we have to pass through the wrapper that we've created
236 extractChildOfKind(lRootElem, aKind, aResult);
237 }
238 }
239 return true;
240}
241
100bool242bool
101JSONDecodeFromRoundtripIterator::decodeXDM(243JSONDecodeFromRoundtripIterator::decodeXDM(
102 const store::Item_t& anObj,244 const store::Item_t& anObj,
@@ -125,32 +267,10 @@
125267
126 zstring lTypeNameString;268 zstring lTypeNameString;
127 lTypeValueItem->getStringValue2(lTypeNameString);269 lTypeValueItem->getStringValue2(lTypeNameString);
128 if (lTypeNameString == "node()")270 store::NodeKind lNodeKind;
271 if (str2kind(lTypeNameString, lNodeKind))
129 {272 {
130 store::LoadProperties lProperties;273 return decodeNode(lValueValueItem, lNodeKind, aResult);
131 lProperties.setStoreDocument(false);
132 store::Item_t lDoc;
133 if (lValueValueItem->isStreamable())
134 {
135 lDoc = GENV.getStore().loadDocument(
136 "", "", lValueValueItem->getStream(), lProperties);
137 }
138 else
139 {
140 zstring lXmlString;
141 lValueValueItem->getStringValue2(lXmlString);
142 std::istringstream lStream(lXmlString.c_str());
143 lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties);
144 }
145 store::Iterator_t lIt = lDoc->getChildren();
146 bool lFound = false;
147 lIt->open();
148 while (! lFound && lIt->next(aResult))
149 {
150 lFound = aResult->getNodeKind() == store::StoreConsts::elementNode;
151 }
152 lIt->close();
153 ZORBA_ASSERT(lFound);
154 }274 }
155 else275 else
156 {276 {
@@ -184,8 +304,8 @@
184 &lTmpNsCtx,304 &lTmpNsCtx,
185 loc);305 loc);
186 }306 }
307 return true;
187 }308 }
188 return true;
189}309}
190310
191bool311bool
@@ -478,23 +598,12 @@
478 store::Item_t& aResult,598 store::Item_t& aResult,
479 JSONEncodeForRoundtripIteratorState* aState) const599 JSONEncodeForRoundtripIteratorState* aState) const
480{600{
481 if (aNode->getNodeKind() != store::StoreConsts::elementNode)
482 {
483 // this is a temporary solution until we decide if/how we encode
484 // node kinds
485 RAISE_ERROR(
486 zerr::ZXQP0004_NOT_IMPLEMENTED,
487 loc,
488 ERROR_PARAMS(store::StoreConsts::toString(aNode->getNodeKind()))
489 );
490 }
491
492 std::vector<store::Item_t> names(2);601 std::vector<store::Item_t> names(2);
493 std::vector<store::Item_t> values(2);602 std::vector<store::Item_t> values(2);
494603
495 {604 {
496 zstring typeKey = aState->thePrefix + TYPE_KEY;605 zstring typeKey = aState->thePrefix + TYPE_KEY;
497 zstring typeValue = "node()";606 zstring typeValue = kind2str(aNode->getNodeKind());
498 GENV_ITEMFACTORY->createString(names.at(0), typeKey);607 GENV_ITEMFACTORY->createString(names.at(0), typeKey);
499 GENV_ITEMFACTORY->createString(values.at(0), typeValue);608 GENV_ITEMFACTORY->createString(values.at(0), typeValue);
500 }609 }
501610
=== modified file 'src/runtime/json/pregenerated/jsoniq_functions.h'
--- src/runtime/json/pregenerated/jsoniq_functions.h 2012-09-24 09:17:44 +0000
+++ src/runtime/json/pregenerated/jsoniq_functions.h 2012-10-01 16:22:23 +0000
@@ -72,6 +72,8 @@
72 virtual ~JSONDecodeFromRoundtripIterator();72 virtual ~JSONDecodeFromRoundtripIterator();
7373
74public:74public:
75 static void extractChildOfKind(const store::Item_t& aParent, const store::NodeKind& aKind, store::Item_t& aChild);
76 bool decodeNode(const store::Item_t& aSerializedNode, const store::NodeKind& aKind, store::Item_t& aResult) const;
75 bool decodeXDM(const store::Item_t& anObj, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;77 bool decodeXDM(const store::Item_t& anObj, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;
76 bool decodeObject(const store::Item_t& anObj, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;78 bool decodeObject(const store::Item_t& anObj, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;
77 bool decodeArray(const store::Item_t& anArray, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;79 bool decodeArray(const store::Item_t& anArray, store::Item_t& aResult, JSONDecodeFromRoundtripIteratorState* aState) const;
7880
=== modified file 'src/runtime/spec/json/jsoniq_functions.xml'
--- src/runtime/spec/json/jsoniq_functions.xml 2012-09-21 19:01:00 +0000
+++ src/runtime/spec/json/jsoniq_functions.xml 2012-10-01 16:22:23 +0000
@@ -40,6 +40,18 @@
40 <zorba:member type="zstring" name="thePrefix" brief=""/>40 <zorba:member type="zstring" name="thePrefix" brief=""/>
41 </zorba:state>41 </zorba:state>
4242
43 <zorba:method static="true" name="extractChildOfKind" return="void">
44 <zorba:param type="const store::Item_t&amp;" name="aParent"/>
45 <zorba:param type="const store::NodeKind&amp;" name="aKind"/>
46 <zorba:param type="store::Item_t&amp;" name="aChild"/>
47 </zorba:method>
48
49 <zorba:method const="true" name="decodeNode" return="bool">
50 <zorba:param type="const store::Item_t&amp;" name="aSerializedNode"/>
51 <zorba:param type="const store::NodeKind&amp;" name="aKind"/>
52 <zorba:param type="store::Item_t&amp;" name="aResult"/>
53 </zorba:method>
54
43 <zorba:method const="true" name="decodeXDM" return="bool">55 <zorba:method const="true" name="decodeXDM" return="bool">
44 <zorba:param type="const store::Item_t&amp;" name="anObj"/>56 <zorba:param type="const store::Item_t&amp;" name="anObj"/>
45 <zorba:param type="store::Item_t&amp;" name="aResult"/>57 <zorba:param type="store::Item_t&amp;" name="aResult"/>
4658
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res 2012-09-15 01:17:21 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "n1" : { "type" : "node()", "value" : "<node>10</node>" }, "n2" : { "type" : "node()", "value" : "<node>20</node>" } }1{ "n1" : { "type" : "element()", "value" : "<node>10</node>" }, "n2" : { "type" : "element()", "value" : "<node>20</node>" } }
22
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res 2012-09-20 04:54:07 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "n1" : { "type" : "node()", "value" : "<node>10</node>" }, "n2" : { "type" : "node()", "value" : "<node>20</node>" } }1{ "n1" : { "type" : "element()", "value" : "<node>10</node>" }, "n2" : { "type" : "element()", "value" : "<node>20</node>" } }
22
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res 2012-09-20 04:54:07 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "n1" : [ { "type" : "node()", "value" : "<node>10</node>" }, 1 ], "n2" : { "type" : "node()", "value" : "<node>20</node>" } }1{ "n1" : [ { "type" : "element()", "value" : "<node>10</node>" }, 1 ], "n2" : { "type" : "element()", "value" : "<node>20</node>" } }
22
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res 2012-09-13 21:35:10 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "serialized XML" : { "Q{http://jsoniq.org/roundtrip}type" : "node()", "Q{http://jsoniq.org/roundtrip}value" : "<para>\n A pair named \"[$prefix]value\" (where [$prefix] is replaced with the\n value of the parameter $prefix) and whose value is a serialization\n of the XML node according to the XML output method and with the\n serialization parameters specified by $param.\n </para>" } }
2\ No newline at end of file1\ No newline at end of file
2{ "serialized XML" : { "Q{http://jsoniq.org/roundtrip}type" : "element()", "Q{http://jsoniq.org/roundtrip}value" : "<para>\n A pair named \"[$prefix]value\" (where [$prefix] is replaced with the\n value of the parameter $prefix) and whose value is a serialization\n of the XML node according to the XML output method and with the\n serialization parameters specified by $param.\n </para>" } }
33
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res 2012-09-13 21:40:53 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "serialized XML" : { "pre-type" : "node()", "pre-value" : "<a>\n <b>text<c>more text</c>\n </b>\n</a>" } }
2\ No newline at end of file1\ No newline at end of file
2{ "serialized XML" : { "pre-type" : "element()", "pre-value" : "<a>\n <b>text<c>more text</c>\n </b>\n</a>" } }
33
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res 2012-10-01 16:22:23 +0000
@@ -0,0 +1,1 @@
1{ "comment" : { "Q{http://jsoniq.org/roundtrip}type" : "comment()", "Q{http://jsoniq.org/roundtrip}value" : "<!--a comment-->" }, "document" : { "Q{http://jsoniq.org/roundtrip}type" : "document-node()", "Q{http://jsoniq.org/roundtrip}value" : "<a/>" }, "pi" : { "Q{http://jsoniq.org/roundtrip}type" : "processing-instruction()", "Q{http://jsoniq.org/roundtrip}value" : "<?target an instruction?>" }, "text" : { "Q{http://jsoniq.org/roundtrip}type" : "text()", "Q{http://jsoniq.org/roundtrip}value" : "some text" } }
02
=== modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res 2012-09-20 17:44:15 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res 2012-10-01 16:22:23 +0000
@@ -1,1 +1,1 @@
1{ "foo" : { "Q{http://jsoniq.org/roundtrip}type" : "node()", "Q{http://jsoniq.org/roundtrip}value" : "<a id=\"bar\"/>" } }1{ "foo" : { "Q{http://jsoniq.org/roundtrip}type" : "element()", "Q{http://jsoniq.org/roundtrip}value" : "<a id=\"bar\"/>" } }
22
=== added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res 2012-10-01 16:22:23 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2true true true true
03
=== added file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq'
--- test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq 2012-10-01 16:22:23 +0000
@@ -0,0 +1,8 @@
1jn:encode-for-roundtrip(
2 {
3 'comment' : comment { "a comment" },
4 'document' : document { <a/> },
5 'pi' : processing-instruction target { "an instruction" },
6 'text' : text { "some text" }
7 }
8)
09
=== added file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq'
--- test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq 2012-10-01 16:22:23 +0000
@@ -0,0 +1,15 @@
1let $enc := jn:encode-for-roundtrip(
2 {
3 'comment' : comment { "a comment" },
4 'document' : document { <a/> } ,
5 'pi' : processing-instruction target { "an instruction" },
6 'text' : text { "some text" }
7 }
8 )
9let $dec := jn:decode-from-roundtrip($enc)
10return (
11 $dec("comment") instance of comment(),
12 $dec("document") instance of document-node(),
13 $dec("pi") instance of processing-instruction(),
14 $dec("text") instance of text()
15)

Subscribers

People subscribed via source and target branches