Merge lp:~zorba-coders/zorba/bug-1055608-node-kinds-for-roundtrip into lp:zorba
- bug-1055608-node-kinds-for-roundtrip
- Merge into trunk
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 | ||||
Related bugs: |
|
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-
Description of the change
use XDM node kinds in encode-
Zorba Build Bot (zorba-buildbot) wrote : | # |
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/
Validation queue job
bug-1055608-node-kinds-
The final status was:
3 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-1055608-node-kinds-
All tests succeeded!
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.
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-1055608-node-kinds-
All tests succeeded!
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.
Matthias Brantner (matthias-brantner) : | # |
Ghislain Fourny (gislenius) wrote : | # |
Looks good, but there is a typo :-) (s/instauction/
Till Westmann (tillw) wrote : | # |
> Looks good, but there is a typo :-) (s/instauction/
fixed. Thanks!
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
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/
Validation queue job
bug-1055608-node-kinds-
The final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
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/
Validation queue job
bug-1055608-node-kinds-
The final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
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/
Validation queue job
bug-1055608-node-kinds-
The final status was:
1 tests did not succeed - changes not commited.
Error in read script: /home/ceej/
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug-1055608-node-kinds-
All tests succeeded!
Preview Diff
1 | === modified file 'src/runtime/json/jsoniq_functions_impl.cpp' | |||
2 | --- src/runtime/json/jsoniq_functions_impl.cpp 2012-09-24 17:11:12 +0000 | |||
3 | +++ src/runtime/json/jsoniq_functions_impl.cpp 2012-10-01 16:22:23 +0000 | |||
4 | @@ -1,12 +1,12 @@ | |||
5 | 1 | /* | 1 | /* |
6 | 2 | * Copyright 2006-2008 The FLWOR Foundation. | 2 | * Copyright 2006-2008 The FLWOR Foundation. |
8 | 3 | * | 3 | * |
9 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
10 | 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. |
11 | 6 | * You may obtain a copy of the License at | 6 | * You may obtain a copy of the License at |
13 | 7 | * | 7 | * |
14 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
16 | 9 | * | 9 | * |
17 | 10 | * Unless required by applicable law or agreed to in writing, software | 10 | * Unless required by applicable law or agreed to in writing, software |
18 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
19 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
20 | @@ -67,6 +67,72 @@ | |||
21 | 67 | const char * OPTIONS_KEY_PREFIX = "prefix"; | 67 | const char * OPTIONS_KEY_PREFIX = "prefix"; |
22 | 68 | const char * OPTIONS_KEY_SER_PARAMS = "serialization-parameters"; | 68 | const char * OPTIONS_KEY_SER_PARAMS = "serialization-parameters"; |
23 | 69 | 69 | ||
24 | 70 | const char * SEQTYPE_ANYNODE = "node()"; | ||
25 | 71 | const char * SEQTYPE_COMMENT = "comment()"; | ||
26 | 72 | const char * SEQTYPE_DOCUMENT = "document-node()"; | ||
27 | 73 | const char * SEQTYPE_ELEMENT = "element()"; | ||
28 | 74 | const char * SEQTYPE_PROCINST = "processing-instruction()"; | ||
29 | 75 | const char * SEQTYPE_TEXT = "text()"; | ||
30 | 76 | |||
31 | 77 | const char * kind2str(const store::NodeKind& aKind) | ||
32 | 78 | { | ||
33 | 79 | // we do not support attibutes and namespaces as they cannot be serialized | ||
34 | 80 | switch (aKind) | ||
35 | 81 | { | ||
36 | 82 | case store::StoreConsts::anyNode: return SEQTYPE_ANYNODE; | ||
37 | 83 | case store::StoreConsts::commentNode: return SEQTYPE_COMMENT; | ||
38 | 84 | case store::StoreConsts::documentNode: return SEQTYPE_DOCUMENT; | ||
39 | 85 | case store::StoreConsts::elementNode: return SEQTYPE_ELEMENT; | ||
40 | 86 | case store::StoreConsts::piNode: return SEQTYPE_PROCINST; | ||
41 | 87 | case store::StoreConsts::textNode: return SEQTYPE_TEXT; | ||
42 | 88 | default: return ""; | ||
43 | 89 | } | ||
44 | 90 | } | ||
45 | 91 | |||
46 | 92 | bool str2kind(const zstring& aString, store::NodeKind& aKind) | ||
47 | 93 | { | ||
48 | 94 | switch(aString.at(0)) | ||
49 | 95 | { | ||
50 | 96 | case 'c': | ||
51 | 97 | if (aString == SEQTYPE_COMMENT) | ||
52 | 98 | { | ||
53 | 99 | aKind = store::StoreConsts::commentNode; | ||
54 | 100 | return true; | ||
55 | 101 | } | ||
56 | 102 | break; | ||
57 | 103 | case 'd': | ||
58 | 104 | if (aString == SEQTYPE_DOCUMENT) | ||
59 | 105 | { | ||
60 | 106 | aKind = store::StoreConsts::documentNode; | ||
61 | 107 | return true; | ||
62 | 108 | } | ||
63 | 109 | break; | ||
64 | 110 | case 'e': | ||
65 | 111 | case 'n': // "node()" maps to element for backwards compatibility | ||
66 | 112 | if (aString == SEQTYPE_ELEMENT || aString == SEQTYPE_ANYNODE) | ||
67 | 113 | { | ||
68 | 114 | aKind = store::StoreConsts::elementNode; | ||
69 | 115 | return true; | ||
70 | 116 | } | ||
71 | 117 | break; | ||
72 | 118 | case 'p': | ||
73 | 119 | if (aString == SEQTYPE_PROCINST) | ||
74 | 120 | { | ||
75 | 121 | aKind = store::StoreConsts::piNode; | ||
76 | 122 | return true; | ||
77 | 123 | } | ||
78 | 124 | break; | ||
79 | 125 | case 't': | ||
80 | 126 | if (aString == SEQTYPE_TEXT) | ||
81 | 127 | { | ||
82 | 128 | aKind = store::StoreConsts::textNode; | ||
83 | 129 | return true; | ||
84 | 130 | } | ||
85 | 131 | break; | ||
86 | 132 | } | ||
87 | 133 | return false; | ||
88 | 134 | } | ||
89 | 135 | |||
90 | 70 | /******************************************************************************* | 136 | /******************************************************************************* |
91 | 71 | json:decode-from-roundtrip($items as json-item()*, | 137 | json:decode-from-roundtrip($items as json-item()*, |
92 | 72 | $options as object()) as structured-item()* | 138 | $options as object()) as structured-item()* |
93 | @@ -97,6 +163,82 @@ | |||
94 | 97 | } | 163 | } |
95 | 98 | } | 164 | } |
96 | 99 | 165 | ||
97 | 166 | void | ||
98 | 167 | JSONDecodeFromRoundtripIterator::extractChildOfKind( | ||
99 | 168 | const store::Item_t& aParent, | ||
100 | 169 | const store::NodeKind& aKind, | ||
101 | 170 | store::Item_t& aChild) | ||
102 | 171 | { | ||
103 | 172 | store::Iterator_t lIt = aParent->getChildren(); | ||
104 | 173 | bool lFound = false; | ||
105 | 174 | lIt->open(); | ||
106 | 175 | while (! lFound && lIt->next(aChild)) | ||
107 | 176 | { | ||
108 | 177 | lFound = aChild->getNodeKind() == aKind; | ||
109 | 178 | } | ||
110 | 179 | lIt->close(); | ||
111 | 180 | ZORBA_ASSERT(lFound); | ||
112 | 181 | } | ||
113 | 182 | |||
114 | 183 | bool | ||
115 | 184 | JSONDecodeFromRoundtripIterator::decodeNode( | ||
116 | 185 | const store::Item_t& aSerializedNode, | ||
117 | 186 | const store::NodeKind& aKind, | ||
118 | 187 | store::Item_t& aResult) const | ||
119 | 188 | { | ||
120 | 189 | store::LoadProperties lProperties; | ||
121 | 190 | lProperties.setStoreDocument(false); | ||
122 | 191 | store::Item_t lDoc; | ||
123 | 192 | zstring lXmlString; | ||
124 | 193 | switch (aKind) | ||
125 | 194 | { | ||
126 | 195 | case store::StoreConsts::commentNode: | ||
127 | 196 | case store::StoreConsts::piNode: | ||
128 | 197 | case store::StoreConsts::textNode: | ||
129 | 198 | { | ||
130 | 199 | // we have to wrap these 3 node kinds, so we cannot care about streams | ||
131 | 200 | aSerializedNode->getStringValue2(lXmlString); | ||
132 | 201 | lXmlString = "<a>" + lXmlString + "</a>"; | ||
133 | 202 | std::istringstream lStream(lXmlString.c_str()); | ||
134 | 203 | lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties); | ||
135 | 204 | } | ||
136 | 205 | break; | ||
137 | 206 | default: | ||
138 | 207 | if (aSerializedNode->isStreamable()) | ||
139 | 208 | { | ||
140 | 209 | lDoc = GENV.getStore().loadDocument( | ||
141 | 210 | "", "", aSerializedNode->getStream(), lProperties); | ||
142 | 211 | } | ||
143 | 212 | else | ||
144 | 213 | { | ||
145 | 214 | aSerializedNode->getStringValue2(lXmlString); | ||
146 | 215 | std::istringstream lStream(lXmlString.c_str()); | ||
147 | 216 | lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties); | ||
148 | 217 | } | ||
149 | 218 | break; | ||
150 | 219 | } | ||
151 | 220 | if (aKind == store::StoreConsts::documentNode) | ||
152 | 221 | { | ||
153 | 222 | aResult = lDoc; | ||
154 | 223 | } | ||
155 | 224 | else | ||
156 | 225 | { | ||
157 | 226 | store::Item_t lRootElem; | ||
158 | 227 | extractChildOfKind(lDoc, store::StoreConsts::elementNode, lRootElem); | ||
159 | 228 | if (aKind == store::StoreConsts::elementNode) | ||
160 | 229 | { | ||
161 | 230 | // if we needed an element we're done | ||
162 | 231 | aResult = lRootElem; | ||
163 | 232 | } | ||
164 | 233 | else | ||
165 | 234 | { | ||
166 | 235 | // otherwise we have to pass through the wrapper that we've created | ||
167 | 236 | extractChildOfKind(lRootElem, aKind, aResult); | ||
168 | 237 | } | ||
169 | 238 | } | ||
170 | 239 | return true; | ||
171 | 240 | } | ||
172 | 241 | |||
173 | 100 | bool | 242 | bool |
174 | 101 | JSONDecodeFromRoundtripIterator::decodeXDM( | 243 | JSONDecodeFromRoundtripIterator::decodeXDM( |
175 | 102 | const store::Item_t& anObj, | 244 | const store::Item_t& anObj, |
176 | @@ -125,32 +267,10 @@ | |||
177 | 125 | 267 | ||
178 | 126 | zstring lTypeNameString; | 268 | zstring lTypeNameString; |
179 | 127 | lTypeValueItem->getStringValue2(lTypeNameString); | 269 | lTypeValueItem->getStringValue2(lTypeNameString); |
181 | 128 | if (lTypeNameString == "node()") | 270 | store::NodeKind lNodeKind; |
182 | 271 | if (str2kind(lTypeNameString, lNodeKind)) | ||
183 | 129 | { | 272 | { |
208 | 130 | store::LoadProperties lProperties; | 273 | return decodeNode(lValueValueItem, lNodeKind, aResult); |
185 | 131 | lProperties.setStoreDocument(false); | ||
186 | 132 | store::Item_t lDoc; | ||
187 | 133 | if (lValueValueItem->isStreamable()) | ||
188 | 134 | { | ||
189 | 135 | lDoc = GENV.getStore().loadDocument( | ||
190 | 136 | "", "", lValueValueItem->getStream(), lProperties); | ||
191 | 137 | } | ||
192 | 138 | else | ||
193 | 139 | { | ||
194 | 140 | zstring lXmlString; | ||
195 | 141 | lValueValueItem->getStringValue2(lXmlString); | ||
196 | 142 | std::istringstream lStream(lXmlString.c_str()); | ||
197 | 143 | lDoc = GENV.getStore().loadDocument("", "", lStream, lProperties); | ||
198 | 144 | } | ||
199 | 145 | store::Iterator_t lIt = lDoc->getChildren(); | ||
200 | 146 | bool lFound = false; | ||
201 | 147 | lIt->open(); | ||
202 | 148 | while (! lFound && lIt->next(aResult)) | ||
203 | 149 | { | ||
204 | 150 | lFound = aResult->getNodeKind() == store::StoreConsts::elementNode; | ||
205 | 151 | } | ||
206 | 152 | lIt->close(); | ||
207 | 153 | ZORBA_ASSERT(lFound); | ||
209 | 154 | } | 274 | } |
210 | 155 | else | 275 | else |
211 | 156 | { | 276 | { |
212 | @@ -184,8 +304,8 @@ | |||
213 | 184 | &lTmpNsCtx, | 304 | &lTmpNsCtx, |
214 | 185 | loc); | 305 | loc); |
215 | 186 | } | 306 | } |
216 | 307 | return true; | ||
217 | 187 | } | 308 | } |
218 | 188 | return true; | ||
219 | 189 | } | 309 | } |
220 | 190 | 310 | ||
221 | 191 | bool | 311 | bool |
222 | @@ -478,23 +598,12 @@ | |||
223 | 478 | store::Item_t& aResult, | 598 | store::Item_t& aResult, |
224 | 479 | JSONEncodeForRoundtripIteratorState* aState) const | 599 | JSONEncodeForRoundtripIteratorState* aState) const |
225 | 480 | { | 600 | { |
226 | 481 | if (aNode->getNodeKind() != store::StoreConsts::elementNode) | ||
227 | 482 | { | ||
228 | 483 | // this is a temporary solution until we decide if/how we encode | ||
229 | 484 | // node kinds | ||
230 | 485 | RAISE_ERROR( | ||
231 | 486 | zerr::ZXQP0004_NOT_IMPLEMENTED, | ||
232 | 487 | loc, | ||
233 | 488 | ERROR_PARAMS(store::StoreConsts::toString(aNode->getNodeKind())) | ||
234 | 489 | ); | ||
235 | 490 | } | ||
236 | 491 | |||
237 | 492 | std::vector<store::Item_t> names(2); | 601 | std::vector<store::Item_t> names(2); |
238 | 493 | std::vector<store::Item_t> values(2); | 602 | std::vector<store::Item_t> values(2); |
239 | 494 | 603 | ||
240 | 495 | { | 604 | { |
241 | 496 | zstring typeKey = aState->thePrefix + TYPE_KEY; | 605 | zstring typeKey = aState->thePrefix + TYPE_KEY; |
243 | 497 | zstring typeValue = "node()"; | 606 | zstring typeValue = kind2str(aNode->getNodeKind()); |
244 | 498 | GENV_ITEMFACTORY->createString(names.at(0), typeKey); | 607 | GENV_ITEMFACTORY->createString(names.at(0), typeKey); |
245 | 499 | GENV_ITEMFACTORY->createString(values.at(0), typeValue); | 608 | GENV_ITEMFACTORY->createString(values.at(0), typeValue); |
246 | 500 | } | 609 | } |
247 | 501 | 610 | ||
248 | === modified file 'src/runtime/json/pregenerated/jsoniq_functions.h' | |||
249 | --- src/runtime/json/pregenerated/jsoniq_functions.h 2012-09-24 09:17:44 +0000 | |||
250 | +++ src/runtime/json/pregenerated/jsoniq_functions.h 2012-10-01 16:22:23 +0000 | |||
251 | @@ -72,6 +72,8 @@ | |||
252 | 72 | virtual ~JSONDecodeFromRoundtripIterator(); | 72 | virtual ~JSONDecodeFromRoundtripIterator(); |
253 | 73 | 73 | ||
254 | 74 | public: | 74 | public: |
255 | 75 | static void extractChildOfKind(const store::Item_t& aParent, const store::NodeKind& aKind, store::Item_t& aChild); | ||
256 | 76 | bool decodeNode(const store::Item_t& aSerializedNode, const store::NodeKind& aKind, store::Item_t& aResult) const; | ||
257 | 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; |
258 | 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; |
259 | 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; |
260 | 78 | 80 | ||
261 | === modified file 'src/runtime/spec/json/jsoniq_functions.xml' | |||
262 | --- src/runtime/spec/json/jsoniq_functions.xml 2012-09-21 19:01:00 +0000 | |||
263 | +++ src/runtime/spec/json/jsoniq_functions.xml 2012-10-01 16:22:23 +0000 | |||
264 | @@ -40,6 +40,18 @@ | |||
265 | 40 | <zorba:member type="zstring" name="thePrefix" brief=""/> | 40 | <zorba:member type="zstring" name="thePrefix" brief=""/> |
266 | 41 | </zorba:state> | 41 | </zorba:state> |
267 | 42 | 42 | ||
268 | 43 | <zorba:method static="true" name="extractChildOfKind" return="void"> | ||
269 | 44 | <zorba:param type="const store::Item_t&" name="aParent"/> | ||
270 | 45 | <zorba:param type="const store::NodeKind&" name="aKind"/> | ||
271 | 46 | <zorba:param type="store::Item_t&" name="aChild"/> | ||
272 | 47 | </zorba:method> | ||
273 | 48 | |||
274 | 49 | <zorba:method const="true" name="decodeNode" return="bool"> | ||
275 | 50 | <zorba:param type="const store::Item_t&" name="aSerializedNode"/> | ||
276 | 51 | <zorba:param type="const store::NodeKind&" name="aKind"/> | ||
277 | 52 | <zorba:param type="store::Item_t&" name="aResult"/> | ||
278 | 53 | </zorba:method> | ||
279 | 54 | |||
280 | 43 | <zorba:method const="true" name="decodeXDM" return="bool"> | 55 | <zorba:method const="true" name="decodeXDM" return="bool"> |
281 | 44 | <zorba:param type="const store::Item_t&" name="anObj"/> | 56 | <zorba:param type="const store::Item_t&" name="anObj"/> |
282 | 45 | <zorba:param type="store::Item_t&" name="aResult"/> | 57 | <zorba:param type="store::Item_t&" name="aResult"/> |
283 | 46 | 58 | ||
284 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res' | |||
285 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res 2012-09-15 01:17:21 +0000 | |||
286 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/jn_accumulate.xml.res 2012-10-01 16:22:23 +0000 | |||
287 | @@ -1,1 +1,1 @@ | |||
289 | 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>" } } |
290 | 2 | 2 | ||
291 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res' | |||
292 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res 2012-09-20 04:54:07 +0000 | |||
293 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_02.xml.res 2012-10-01 16:22:23 +0000 | |||
294 | @@ -1,1 +1,1 @@ | |||
296 | 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>" } } |
297 | 2 | 2 | ||
298 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res' | |||
299 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res 2012-09-20 04:54:07 +0000 | |||
300 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_04.xml.res 2012-10-01 16:22:23 +0000 | |||
301 | @@ -1,1 +1,1 @@ | |||
303 | 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>" } } |
304 | 2 | 2 | ||
305 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res' | |||
306 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res 2012-09-13 21:35:10 +0000 | |||
307 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_03.xml.res 2012-10-01 16:22:23 +0000 | |||
308 | @@ -1,1 +1,1 @@ | |||
309 | 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>" } } | ||
310 | 2 | \ No newline at end of file | 1 | \ No newline at end of file |
311 | 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>" } } | ||
312 | 3 | 3 | ||
313 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res' | |||
314 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res 2012-09-13 21:40:53 +0000 | |||
315 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_04.xml.res 2012-10-01 16:22:23 +0000 | |||
316 | @@ -1,1 +1,1 @@ | |||
317 | 1 | { "serialized XML" : { "pre-type" : "node()", "pre-value" : "<a>\n <b>text<c>more text</c>\n </b>\n</a>" } } | ||
318 | 2 | \ No newline at end of file | 1 | \ No newline at end of file |
319 | 2 | { "serialized XML" : { "pre-type" : "element()", "pre-value" : "<a>\n <b>text<c>more text</c>\n </b>\n</a>" } } | ||
320 | 3 | 3 | ||
321 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res' | |||
322 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res 1970-01-01 00:00:00 +0000 | |||
323 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/encode_10.xml.res 2012-10-01 16:22:23 +0000 | |||
324 | @@ -0,0 +1,1 @@ | |||
325 | 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" } } | ||
326 | 0 | 2 | ||
327 | === modified file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res' | |||
328 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res 2012-09-20 17:44:15 +0000 | |||
329 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_03.xml.res 2012-10-01 16:22:23 +0000 | |||
330 | @@ -1,1 +1,1 @@ | |||
332 | 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\"/>" } } |
333 | 2 | 2 | ||
334 | === added file 'test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res' | |||
335 | --- test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res 1970-01-01 00:00:00 +0000 | |||
336 | +++ test/rbkt/ExpQueryResults/zorba/jsoniq/roundtrip/roundtrip_06.xml.res 2012-10-01 16:22:23 +0000 | |||
337 | @@ -0,0 +1,2 @@ | |||
338 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
339 | 2 | true true true true | ||
340 | 0 | 3 | ||
341 | === added file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq' | |||
342 | --- test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq 1970-01-01 00:00:00 +0000 | |||
343 | +++ test/rbkt/Queries/zorba/jsoniq/roundtrip/encode_10.xq 2012-10-01 16:22:23 +0000 | |||
344 | @@ -0,0 +1,8 @@ | |||
345 | 1 | jn:encode-for-roundtrip( | ||
346 | 2 | { | ||
347 | 3 | 'comment' : comment { "a comment" }, | ||
348 | 4 | 'document' : document { <a/> }, | ||
349 | 5 | 'pi' : processing-instruction target { "an instruction" }, | ||
350 | 6 | 'text' : text { "some text" } | ||
351 | 7 | } | ||
352 | 8 | ) | ||
353 | 0 | 9 | ||
354 | === added file 'test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq' | |||
355 | --- test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq 1970-01-01 00:00:00 +0000 | |||
356 | +++ test/rbkt/Queries/zorba/jsoniq/roundtrip/roundtrip_06.xq 2012-10-01 16:22:23 +0000 | |||
357 | @@ -0,0 +1,15 @@ | |||
358 | 1 | let $enc := jn:encode-for-roundtrip( | ||
359 | 2 | { | ||
360 | 3 | 'comment' : comment { "a comment" }, | ||
361 | 4 | 'document' : document { <a/> } , | ||
362 | 5 | 'pi' : processing-instruction target { "an instruction" }, | ||
363 | 6 | 'text' : text { "some text" } | ||
364 | 7 | } | ||
365 | 8 | ) | ||
366 | 9 | let $dec := jn:decode-from-roundtrip($enc) | ||
367 | 10 | return ( | ||
368 | 11 | $dec("comment") instance of comment(), | ||
369 | 12 | $dec("document") instance of document-node(), | ||
370 | 13 | $dec("pi") instance of processing-instruction(), | ||
371 | 14 | $dec("text") instance of text() | ||
372 | 15 | ) |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug-1055608- node-kinds- for-roundtrip- 2012-09- 27T02-17- 43.713Z/ log.html
Log at: http://