Merge lp:~zorba-coders/zorba/bug1147563 into lp:zorba
- bug1147563
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Sorin Marian Nasoi | ||||
Approved revision: | 11316 | ||||
Merged at revision: | 11419 | ||||
Proposed branch: | lp:~zorba-coders/zorba/bug1147563 | ||||
Merge into: | lp:zorba | ||||
Diff against target: |
1714 lines (+471/-337) 24 files modified
ChangeLog (+2/-0) src/compiler/translator/translator.cpp (+4/-2) src/runtime/accessors/accessors_impl.cpp (+10/-2) src/runtime/core/path_iterators.cpp (+2/-2) src/runtime/core/sequencetypes.cpp (+1/-1) src/runtime/visitors/printer_visitor_impl.cpp (+19/-15) src/store/api/item.h (+1/-1) src/store/naive/item.cpp (+1/-1) src/store/naive/node_items.cpp (+26/-24) src/store/naive/node_items.h (+1/-7) src/types/root_typemanager.cpp (+3/-0) src/types/schema/schema.cpp (+85/-80) src/types/schema/schema.h (+24/-21) src/types/schema/validate.cpp (+16/-12) src/types/typeimpl.cpp (+181/-88) src/types/typeimpl.h (+24/-17) src/types/typemanager.h (+4/-3) src/types/typemanagerimpl.cpp (+14/-8) src/types/typemanagerimpl.h (+4/-3) src/types/typeops.cpp (+26/-14) test/fots/CMakeLists.txt (+16/-31) test/rbkt/Queries/zorba/schemas/books.xsd (+2/-2) test/update/Scripts/Readme.txt (+2/-3) test/update/updtestdriver.cpp (+3/-0) |
||||
To merge this branch: | bzr merge lp:~zorba-coders/zorba/bug1147563 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sorin Marian Nasoi | Approve | ||
Chris Hillery | Approve | ||
Markos Zaharioudakis | Approve | ||
Cezar Andrei | Approve | ||
Review via email: mp+160839@code.launchpad.net |
Commit message
Fixes for nilled function
Description of the change
Fixes for nilled function
Sorin Marian Nasoi (sorin.marian.nasoi) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Sorin Marian Nasoi (sorin.marian.nasoi) wrote : | # |
there are 8 more schema & nillable items failures: please see
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug1147563-2013-04-
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, Needs Information < 1, Resubmit < 1. Got: 1 Approve, 4 Pending.
Cezar Andrei (cezar-andrei) : | # |
Sorin Marian Nasoi (sorin.marian.nasoi) wrote : | # |
In case I was not clear enough in
https:/
This merge, as it is now, passed all RQ tests as one can see in the logs above and thus can be merged "as is".
However, there are 8 more failing test-cases that seem to be connected to nilled function:
in "prod-SchemaImport" related to nillable elements:
cbcl-schema-
All these 8 failing test-cases are narked as EXPECTED_
http://
So, the question is do we either:
1) fix these 8 failures in this merge
2) or do we commit this merge and we open a new bug for the rest of 8 failures (even though they may be connected to nilled function)
Markos Zaharioudakis (markos-za) : | # |
Cezar Andrei (cezar-andrei) wrote : | # |
Let's get this is and open up a new bug for the 8 failures.
Chris Hillery (ceejatec) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Attempt to merge into lp:zorba failed due to conflicts:
text conflict in src/compiler/
text conflict in test/fots/
Sorin Marian Nasoi (sorin.marian.nasoi) : | # |
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/bug1147563 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug1147563-2013-04-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
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/bug1147563 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug1147563-2013-04-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
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/bug1147563 into lp:zorba failed. Below is the output from the failed tests.
CMake Error at /home/ceej/
Validation queue job bug1147563-2013-04-
final status was:
No tests were run - build or configure step must have failed.
Not commiting changes.
Error in read script: /home/ceej/
Sorin Marian Nasoi (sorin.marian.nasoi) : | # |
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue starting for merge proposal.
Log at: http://
Zorba Build Bot (zorba-buildbot) wrote : | # |
Validation queue job bug1147563-2013-04-
All tests succeeded!
Preview Diff
1 | === modified file 'ChangeLog' | |||
2 | --- ChangeLog 2013-04-30 18:31:49 +0000 | |||
3 | +++ ChangeLog 2013-04-30 21:00:38 +0000 | |||
4 | @@ -49,6 +49,8 @@ | |||
5 | 49 | * Fixed bug #1124273 (xqdoc crash because of annotation literals) | 49 | * Fixed bug #1124273 (xqdoc crash because of annotation literals) |
6 | 50 | * Fixed bug #1085408 (xs:date(): casting large year values) | 50 | * Fixed bug #1085408 (xs:date(): casting large year values) |
7 | 51 | * Fixed bug #867027 (XQST0059 error messages inconsistent) | 51 | * Fixed bug #867027 (XQST0059 error messages inconsistent) |
8 | 52 | * Fixed fn:nilled function | ||
9 | 53 | * Fixed bug concerning nillability during sequnce type matching. | ||
10 | 52 | * Fixed bug in handling the type declaration of a FOR variable that allows empty. | 54 | * Fixed bug in handling the type declaration of a FOR variable that allows empty. |
11 | 53 | * Fixed bug #1095889 (Improve error message for xml-parsing error). | 55 | * Fixed bug #1095889 (Improve error message for xml-parsing error). |
12 | 54 | * Fixed bug #1131984 (apparently invalid regex in queries) | 56 | * Fixed bug #1131984 (apparently invalid regex in queries) |
13 | 55 | 57 | ||
14 | === modified file 'src/compiler/translator/translator.cpp' | |||
15 | --- src/compiler/translator/translator.cpp 2013-04-30 18:31:49 +0000 | |||
16 | +++ src/compiler/translator/translator.cpp 2013-04-30 21:00:38 +0000 | |||
17 | @@ -14298,13 +14298,15 @@ | |||
18 | 14298 | 14298 | ||
19 | 14299 | if (axisExpr != NULL) | 14299 | if (axisExpr != NULL) |
20 | 14300 | { | 14300 | { |
21 | 14301 | bool nillable; | ||
22 | 14301 | store::Item_t typeQNameItem; | 14302 | store::Item_t typeQNameItem; |
24 | 14302 | CTX_TM->get_schema_element_typename(elemQNameItem, typeQNameItem, loc); | 14303 | CTX_TM->get_schema_element_typeinfo(elemQNameItem, typeQNameItem, nillable, loc); |
25 | 14303 | 14304 | ||
26 | 14304 | match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); | 14305 | match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); |
27 | 14305 | match->setTestKind(match_xs_elem_test); | 14306 | match->setTestKind(match_xs_elem_test); |
28 | 14306 | match->setQName(elemQNameItem); | 14307 | match->setQName(elemQNameItem); |
29 | 14307 | match->setTypeName(typeQNameItem); | 14308 | match->setTypeName(typeQNameItem); |
30 | 14309 | match->setNilledAllowed(nillable); | ||
31 | 14308 | 14310 | ||
32 | 14309 | axisExpr->setTest(match); | 14311 | axisExpr->setTest(match); |
33 | 14310 | } | 14312 | } |
34 | @@ -14422,7 +14424,7 @@ | |||
35 | 14422 | if (axisExpr != NULL) | 14424 | if (axisExpr != NULL) |
36 | 14423 | { | 14425 | { |
37 | 14424 | store::Item_t typeQNameItem; | 14426 | store::Item_t typeQNameItem; |
39 | 14425 | CTX_TM->get_schema_attribute_typename(attrQNameItem, typeQNameItem, loc); | 14427 | CTX_TM->get_schema_attribute_typeinfo(attrQNameItem, typeQNameItem, loc); |
40 | 14426 | 14428 | ||
41 | 14427 | match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); | 14429 | match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); |
42 | 14428 | match->setTestKind(match_xs_attr_test); | 14430 | match->setTestKind(match_xs_attr_test); |
43 | 14429 | 14431 | ||
44 | === modified file 'src/runtime/accessors/accessors_impl.cpp' | |||
45 | --- src/runtime/accessors/accessors_impl.cpp 2013-03-15 08:22:41 +0000 | |||
46 | +++ src/runtime/accessors/accessors_impl.cpp 2013-04-30 21:00:38 +0000 | |||
47 | @@ -105,8 +105,15 @@ | |||
48 | 105 | { | 105 | { |
49 | 106 | if (inNode->isNode()) | 106 | if (inNode->isNode()) |
50 | 107 | { | 107 | { |
53 | 108 | result = inNode->getNilled(); | 108 | if (inNode->getNodeKind() == store::StoreConsts::elementNode) |
54 | 109 | STACK_PUSH(result != NULL, state); | 109 | { |
55 | 110 | GENV_ITEMFACTORY->createBoolean(result, inNode->getNilled()); | ||
56 | 111 | STACK_PUSH(true, state); | ||
57 | 112 | } | ||
58 | 113 | else | ||
59 | 114 | { | ||
60 | 115 | STACK_PUSH(false, state); | ||
61 | 116 | } | ||
62 | 110 | } | 117 | } |
63 | 111 | else | 118 | else |
64 | 112 | { | 119 | { |
65 | @@ -240,6 +247,7 @@ | |||
66 | 240 | } | 247 | } |
67 | 241 | 248 | ||
68 | 242 | state->theTypedValueIter = 0; // TODO remove??? | 249 | state->theTypedValueIter = 0; // TODO remove??? |
69 | 250 | |||
70 | 243 | STACK_END(state); | 251 | STACK_END(state); |
71 | 244 | } | 252 | } |
72 | 245 | 253 | ||
73 | 246 | 254 | ||
74 | === modified file 'src/runtime/core/path_iterators.cpp' | |||
75 | --- src/runtime/core/path_iterators.cpp 2013-04-08 15:07:13 +0000 | |||
76 | +++ src/runtime/core/path_iterators.cpp 2013-04-30 21:00:38 +0000 | |||
77 | @@ -313,7 +313,7 @@ | |||
78 | 313 | 313 | ||
79 | 314 | if ((!TypeOps::is_subtype(sctx->get_typemanager(), *atype, *theType)) || | 314 | if ((!TypeOps::is_subtype(sctx->get_typemanager(), *atype, *theType)) || |
80 | 315 | (theNilledAllowed == false && | 315 | (theNilledAllowed == false && |
82 | 316 | node->getNilled()->getBooleanValue() == true)) | 316 | node->getNilled() == true)) |
83 | 317 | { | 317 | { |
84 | 318 | return false; | 318 | return false; |
85 | 319 | } | 319 | } |
86 | @@ -338,7 +338,7 @@ | |||
87 | 338 | 338 | ||
88 | 339 | if ((!TypeOps::is_subtype(sctx->get_typemanager(), *atype, *theType)) || | 339 | if ((!TypeOps::is_subtype(sctx->get_typemanager(), *atype, *theType)) || |
89 | 340 | (theNilledAllowed == false && | 340 | (theNilledAllowed == false && |
91 | 341 | node->getNilled()->getBooleanValue() == true)) | 341 | node->getNilled() == true)) |
92 | 342 | return false; | 342 | return false; |
93 | 343 | 343 | ||
94 | 344 | return true; | 344 | return true; |
95 | 345 | 345 | ||
96 | === modified file 'src/runtime/core/sequencetypes.cpp' | |||
97 | --- src/runtime/core/sequencetypes.cpp 2013-04-18 08:47:43 +0000 | |||
98 | +++ src/runtime/core/sequencetypes.cpp 2013-04-30 21:00:38 +0000 | |||
99 | @@ -84,7 +84,7 @@ | |||
100 | 84 | store::Item_t item; | 84 | store::Item_t item; |
101 | 85 | TypeConstants::quantifier_t quant; | 85 | TypeConstants::quantifier_t quant; |
102 | 86 | bool res = false; | 86 | bool res = false; |
104 | 87 | 87 | store::Item_t temp; | |
105 | 88 | const TypeManager* tm = theSctx->get_typemanager(); | 88 | const TypeManager* tm = theSctx->get_typemanager(); |
106 | 89 | 89 | ||
107 | 90 | PlanIteratorState* state; | 90 | PlanIteratorState* state; |
108 | 91 | 91 | ||
109 | === modified file 'src/runtime/visitors/printer_visitor_impl.cpp' | |||
110 | --- src/runtime/visitors/printer_visitor_impl.cpp 2013-03-27 07:55:14 +0000 | |||
111 | +++ src/runtime/visitors/printer_visitor_impl.cpp 2013-04-30 21:00:38 +0000 | |||
112 | @@ -208,21 +208,6 @@ | |||
113 | 208 | thePrinter.endEndVisit(); | 208 | thePrinter.endEndVisit(); |
114 | 209 | } | 209 | } |
115 | 210 | 210 | ||
116 | 211 | void PrinterVisitor::beginVisit ( const TreatIterator& a ) | ||
117 | 212 | { | ||
118 | 213 | thePrinter.startBeginVisit("TreatIterator", ++theId); | ||
119 | 214 | if (a.theCheckPrime) | ||
120 | 215 | thePrinter.addAttribute("type", a.theTreatType->toString()); | ||
121 | 216 | thePrinter.addAttribute("quant", TypeOps::decode_quantifier(a.theQuantifier)); | ||
122 | 217 | printCommons( &a, theId ); | ||
123 | 218 | thePrinter.endBeginVisit(theId); | ||
124 | 219 | } | ||
125 | 220 | |||
126 | 221 | void PrinterVisitor::endVisit ( const TreatIterator& ) | ||
127 | 222 | { | ||
128 | 223 | thePrinter.startEndVisit(); | ||
129 | 224 | thePrinter.endEndVisit(); | ||
130 | 225 | } | ||
131 | 226 | 211 | ||
132 | 227 | void PrinterVisitor::beginVisit ( const NumArithIterator<AddOperation>& a ) | 212 | void PrinterVisitor::beginVisit ( const NumArithIterator<AddOperation>& a ) |
133 | 228 | { | 213 | { |
134 | @@ -1176,6 +1161,7 @@ | |||
135 | 1176 | thePrinter.endEndVisit(); | 1161 | thePrinter.endEndVisit(); |
136 | 1177 | } | 1162 | } |
137 | 1178 | 1163 | ||
138 | 1164 | |||
139 | 1179 | void PrinterVisitor::beginVisit(const PromoteIterator& a) | 1165 | void PrinterVisitor::beginVisit(const PromoteIterator& a) |
140 | 1180 | { | 1166 | { |
141 | 1181 | thePrinter.startBeginVisit("PromoteIterator", ++theId); | 1167 | thePrinter.startBeginVisit("PromoteIterator", ++theId); |
142 | @@ -1192,6 +1178,24 @@ | |||
143 | 1192 | thePrinter.endEndVisit(); | 1178 | thePrinter.endEndVisit(); |
144 | 1193 | } | 1179 | } |
145 | 1194 | 1180 | ||
146 | 1181 | |||
147 | 1182 | void PrinterVisitor::beginVisit ( const TreatIterator& a ) | ||
148 | 1183 | { | ||
149 | 1184 | thePrinter.startBeginVisit("TreatIterator", ++theId); | ||
150 | 1185 | if (a.theCheckPrime) | ||
151 | 1186 | thePrinter.addAttribute("type", a.theTreatType->toString()); | ||
152 | 1187 | thePrinter.addAttribute("quant", TypeOps::decode_quantifier(a.theQuantifier)); | ||
153 | 1188 | printCommons( &a, theId ); | ||
154 | 1189 | thePrinter.endBeginVisit(theId); | ||
155 | 1190 | } | ||
156 | 1191 | |||
157 | 1192 | void PrinterVisitor::endVisit ( const TreatIterator& ) | ||
158 | 1193 | { | ||
159 | 1194 | thePrinter.startEndVisit(); | ||
160 | 1195 | thePrinter.endEndVisit(); | ||
161 | 1196 | } | ||
162 | 1197 | |||
163 | 1198 | |||
164 | 1195 | void PrinterVisitor::beginVisit(const CastableIterator& a) | 1199 | void PrinterVisitor::beginVisit(const CastableIterator& a) |
165 | 1196 | { | 1200 | { |
166 | 1197 | thePrinter.startBeginVisit("CastableIterator", ++theId); | 1201 | thePrinter.startBeginVisit("CastableIterator", ++theId); |
167 | 1198 | 1202 | ||
168 | === modified file 'src/store/api/item.h' | |||
169 | --- src/store/api/item.h 2013-04-08 00:44:26 +0000 | |||
170 | +++ src/store/api/item.h 2013-04-30 21:00:38 +0000 | |||
171 | @@ -674,7 +674,7 @@ | |||
172 | 674 | /** Accessor for element node | 674 | /** Accessor for element node |
173 | 675 | * @return boolean? | 675 | * @return boolean? |
174 | 676 | */ | 676 | */ |
176 | 677 | virtual Item_t | 677 | virtual bool |
177 | 678 | getNilled() const; | 678 | getNilled() const; |
178 | 679 | 679 | ||
179 | 680 | /** Accessor for document node, element node, attribute node, namespace node, | 680 | /** Accessor for document node, element node, attribute node, namespace node, |
180 | 681 | 681 | ||
181 | === modified file 'src/store/naive/item.cpp' | |||
182 | --- src/store/naive/item.cpp 2013-04-08 00:44:26 +0000 | |||
183 | +++ src/store/naive/item.cpp 2013-04-30 21:00:38 +0000 | |||
184 | @@ -976,7 +976,7 @@ | |||
185 | 976 | } | 976 | } |
186 | 977 | 977 | ||
187 | 978 | 978 | ||
189 | 979 | store::Item_t Item::getNilled() const | 979 | bool Item::getNilled() const |
190 | 980 | { | 980 | { |
191 | 981 | throw ZORBA_EXCEPTION( | 981 | throw ZORBA_EXCEPTION( |
192 | 982 | zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, | 982 | zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, |
193 | 983 | 983 | ||
194 | === modified file 'src/store/naive/node_items.cpp' | |||
195 | --- src/store/naive/node_items.cpp 2013-04-17 12:37:36 +0000 | |||
196 | +++ src/store/naive/node_items.cpp 2013-04-30 21:00:38 +0000 | |||
197 | @@ -2968,6 +2968,17 @@ | |||
198 | 2968 | { | 2968 | { |
199 | 2969 | zstring rch; | 2969 | zstring rch; |
200 | 2970 | getStringValue2(rch); | 2970 | getStringValue2(rch); |
201 | 2971 | |||
202 | 2972 | if (rch.empty()) | ||
203 | 2973 | { | ||
204 | 2974 | if (getNilled()) | ||
205 | 2975 | { | ||
206 | 2976 | val = NULL; | ||
207 | 2977 | iter = NULL; | ||
208 | 2978 | return; | ||
209 | 2979 | } | ||
210 | 2980 | } | ||
211 | 2981 | |||
212 | 2971 | GET_FACTORY().createUntypedAtomic(val, rch); | 2982 | GET_FACTORY().createUntypedAtomic(val, rch); |
213 | 2972 | } | 2983 | } |
214 | 2973 | } | 2984 | } |
215 | @@ -3048,17 +3059,15 @@ | |||
216 | 3048 | /******************************************************************************* | 3059 | /******************************************************************************* |
217 | 3049 | 3060 | ||
218 | 3050 | ********************************************************************************/ | 3061 | ********************************************************************************/ |
220 | 3051 | store::Item_t ElementNode::getNilled() const | 3062 | bool ElementNode::getNilled() const |
221 | 3052 | { | 3063 | { |
222 | 3053 | store::Item_t val; | 3064 | store::Item_t val; |
223 | 3054 | 3065 | ||
224 | 3055 | if (getType()->equals(GET_STORE().XS_UNTYPED_QNAME)) | 3066 | if (getType()->equals(GET_STORE().XS_UNTYPED_QNAME)) |
229 | 3056 | { | 3067 | return false; |
226 | 3057 | GET_FACTORY().createBoolean(val, false); | ||
227 | 3058 | return val; | ||
228 | 3059 | } | ||
230 | 3060 | 3068 | ||
232 | 3061 | bool nilled = true; | 3069 | if (!isValidated()) |
233 | 3070 | return false; | ||
234 | 3062 | 3071 | ||
235 | 3063 | const_iterator ite = childrenBegin(); | 3072 | const_iterator ite = childrenBegin(); |
236 | 3064 | const_iterator end = childrenEnd(); | 3073 | const_iterator end = childrenEnd(); |
237 | @@ -3068,38 +3077,31 @@ | |||
238 | 3068 | if ((*ite)->getNodeKind() == store::StoreConsts::elementNode || | 3077 | if ((*ite)->getNodeKind() == store::StoreConsts::elementNode || |
239 | 3069 | (*ite)->getNodeKind() == store::StoreConsts::textNode) | 3078 | (*ite)->getNodeKind() == store::StoreConsts::textNode) |
240 | 3070 | { | 3079 | { |
243 | 3071 | nilled = false; | 3080 | return false; |
242 | 3072 | break; | ||
244 | 3073 | } | 3081 | } |
245 | 3074 | } | 3082 | } |
246 | 3075 | 3083 | ||
247 | 3076 | if (!nilled) | ||
248 | 3077 | { | ||
249 | 3078 | GET_FACTORY().createBoolean(val, false); | ||
250 | 3079 | return val; | ||
251 | 3080 | } | ||
252 | 3081 | |||
253 | 3082 | nilled = false; | ||
254 | 3083 | |||
255 | 3084 | //const char* xsi = "http://www.w3.org/2001/XMLSchema-instance"; | ||
256 | 3085 | //ulong xsilen = strlen(xsi); | ||
257 | 3086 | |||
258 | 3087 | ite = attrsBegin(); | 3084 | ite = attrsBegin(); |
259 | 3088 | end = attrsEnd(); | 3085 | end = attrsEnd(); |
260 | 3089 | 3086 | ||
261 | 3090 | for (; ite != end; ++ite) | 3087 | for (; ite != end; ++ite) |
262 | 3091 | { | 3088 | { |
263 | 3092 | XmlNode* attr = *ite; | 3089 | XmlNode* attr = *ite; |
266 | 3093 | if (ZSTREQ(attr->getNodeName()->getNamespace(), "xsi") && | 3090 | |
267 | 3094 | ZSTREQ(attr->getNodeName()->getLocalName(), "nil")) | 3091 | zstring strval; |
268 | 3092 | attr->getStringValue2(strval); | ||
269 | 3093 | |||
270 | 3094 | if (ZSTREQ(attr->getNodeName()->getNamespace(), | ||
271 | 3095 | "http://www.w3.org/2001/XMLSchema-instance") && | ||
272 | 3096 | ZSTREQ(attr->getNodeName()->getLocalName(), "nil") && | ||
273 | 3097 | (ZSTREQ(strval, "true") || ZSTREQ(strval, "1") )) | ||
274 | 3095 | { | 3098 | { |
276 | 3096 | nilled = true; | 3099 | return true; |
277 | 3097 | break; | 3100 | break; |
278 | 3098 | } | 3101 | } |
279 | 3099 | } | 3102 | } |
280 | 3100 | 3103 | ||
283 | 3101 | GET_FACTORY().createBoolean(val, nilled); | 3104 | return false; |
282 | 3102 | return val; | ||
284 | 3103 | } | 3105 | } |
285 | 3104 | 3106 | ||
286 | 3105 | 3107 | ||
287 | 3106 | 3108 | ||
288 | === modified file 'src/store/naive/node_items.h' | |||
289 | --- src/store/naive/node_items.h 2013-03-07 10:10:10 +0000 | |||
290 | +++ src/store/naive/node_items.h 2013-04-30 21:00:38 +0000 | |||
291 | @@ -500,12 +500,6 @@ | |||
292 | 500 | 500 | ||
293 | 501 | store::Item* copy(store::Item* parent, const store::CopyMode& copymode) const; | 501 | store::Item* copy(store::Item* parent, const store::CopyMode& copymode) const; |
294 | 502 | 502 | ||
295 | 503 | virtual store::Item_t getNilled() const | ||
296 | 504 | { | ||
297 | 505 | assert(!isConnectorNode()); | ||
298 | 506 | return 0; | ||
299 | 507 | } | ||
300 | 508 | |||
301 | 509 | virtual bool isId() const | 503 | virtual bool isId() const |
302 | 510 | { | 504 | { |
303 | 511 | assert(!isConnectorNode()); | 505 | assert(!isConnectorNode()); |
304 | @@ -1072,7 +1066,7 @@ | |||
305 | 1072 | 1066 | ||
306 | 1073 | void appendStringValue(zstring& buf) const; | 1067 | void appendStringValue(zstring& buf) const; |
307 | 1074 | 1068 | ||
309 | 1075 | store::Item_t getNilled() const; | 1069 | bool getNilled() const; |
310 | 1076 | 1070 | ||
311 | 1077 | store::Iterator_t getAttributes() const; | 1071 | store::Iterator_t getAttributes() const; |
312 | 1078 | 1072 | ||
313 | 1079 | 1073 | ||
314 | === modified file 'src/types/root_typemanager.cpp' | |||
315 | --- src/types/root_typemanager.cpp 2013-03-20 18:39:54 +0000 | |||
316 | +++ src/types/root_typemanager.cpp 2013-04-30 21:00:38 +0000 | |||
317 | @@ -386,18 +386,21 @@ | |||
318 | 386 | #undef ATOMIC_TYPE_DEFN | 386 | #undef ATOMIC_TYPE_DEFN |
319 | 387 | 387 | ||
320 | 388 | XS_NMTOKENS_TYPE = new UserDefinedXQType(this, | 388 | XS_NMTOKENS_TYPE = new UserDefinedXQType(this, |
321 | 389 | false, | ||
322 | 389 | XS_NMTOKENS_QNAME, | 390 | XS_NMTOKENS_QNAME, |
323 | 390 | NULL, | 391 | NULL, |
324 | 391 | NMTOKEN_TYPE_ONE.getp(), | 392 | NMTOKEN_TYPE_ONE.getp(), |
325 | 392 | true); | 393 | true); |
326 | 393 | 394 | ||
327 | 394 | XS_ENTITIES_TYPE = new UserDefinedXQType(this, | 395 | XS_ENTITIES_TYPE = new UserDefinedXQType(this, |
328 | 396 | false, | ||
329 | 395 | XS_ENTITIES_QNAME, | 397 | XS_ENTITIES_QNAME, |
330 | 396 | NULL, | 398 | NULL, |
331 | 397 | ENTITY_TYPE_ONE.getp(), | 399 | ENTITY_TYPE_ONE.getp(), |
332 | 398 | true); | 400 | true); |
333 | 399 | 401 | ||
334 | 400 | XS_IDREFS_TYPE = new UserDefinedXQType(this, | 402 | XS_IDREFS_TYPE = new UserDefinedXQType(this, |
335 | 403 | false, | ||
336 | 401 | XS_IDREFS_QNAME, | 404 | XS_IDREFS_QNAME, |
337 | 402 | NULL, | 405 | NULL, |
338 | 403 | IDREF_TYPE_ONE.getp(), | 406 | IDREF_TYPE_ONE.getp(), |
339 | 404 | 407 | ||
340 | === modified file 'src/types/schema/schema.cpp' | |||
341 | --- src/types/schema/schema.cpp 2013-04-16 21:12:12 +0000 | |||
342 | +++ src/types/schema/schema.cpp 2013-04-30 21:00:38 +0000 | |||
343 | @@ -259,7 +259,8 @@ | |||
344 | 259 | 259 | ||
345 | 260 | return lRetval; | 260 | return lRetval; |
346 | 261 | } | 261 | } |
348 | 262 | else { | 262 | else |
349 | 263 | { | ||
350 | 263 | // We didn't find it. If we return NULL here, Xerces will try to | 264 | // We didn't find it. If we return NULL here, Xerces will try to |
351 | 264 | // resolve it its own way, which we don't want to happen. | 265 | // resolve it its own way, which we don't want to happen. |
352 | 265 | throw XQUERY_EXCEPTION( | 266 | throw XQUERY_EXCEPTION( |
353 | @@ -271,7 +272,8 @@ | |||
354 | 271 | ); | 272 | ); |
355 | 272 | } | 273 | } |
356 | 273 | } | 274 | } |
358 | 274 | catch (ZorbaException const& e) { | 275 | catch (ZorbaException const& e) |
359 | 276 | { | ||
360 | 275 | TRACE("!!! ZorbaException: " << e ); | 277 | TRACE("!!! ZorbaException: " << e ); |
361 | 276 | if ( e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED || | 278 | if ( e.diagnostic() == zerr::ZXQP0029_URI_ACCESS_DENIED || |
362 | 277 | e.diagnostic() == err::XQST0059 ) | 279 | e.diagnostic() == err::XQST0059 ) |
363 | @@ -518,82 +520,71 @@ | |||
364 | 518 | 520 | ||
365 | 519 | 521 | ||
366 | 520 | /******************************************************************************* | 522 | /******************************************************************************* |
368 | 521 | For the given element name find out its declared schema type | 523 | Find a global element declaration for a given element name and return the name |
369 | 524 | of the associated schema type and whether the element can be nillable. | ||
370 | 525 | Raise an error if no global element declaration is found for the given name. | ||
371 | 522 | *******************************************************************************/ | 526 | *******************************************************************************/ |
373 | 523 | void Schema::getTypeNameFromElementName( | 527 | void Schema::getInfoFromGlobalElementDecl( |
374 | 524 | const store::Item* qname, | 528 | const store::Item* qname, |
375 | 525 | store::Item_t& typeName, | 529 | store::Item_t& typeName, |
376 | 530 | bool& nillable, | ||
377 | 526 | const QueryLoc& loc) | 531 | const QueryLoc& loc) |
378 | 527 | { | 532 | { |
380 | 528 | XSTypeDefinition* typeDef = getTypeDefForElement(qname); | 533 | XSElementDeclaration* decl = getDeclForElement(qname); |
381 | 529 | 534 | ||
383 | 530 | if (!typeDef) | 535 | if (!decl) |
384 | 531 | { | 536 | { |
385 | 532 | RAISE_ERROR(err::XPST0008, loc, | 537 | RAISE_ERROR(err::XPST0008, loc, |
386 | 533 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); | 538 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); |
387 | 534 | } | 539 | } |
388 | 535 | 540 | ||
430 | 536 | const XMLCh* typeNameStr = typeDef->getName(); | 541 | XSTypeDefinition* typeDef = decl->getTypeDefinition(); |
431 | 537 | const XMLCh* typeUri = typeDef->getNamespace(); | 542 | |
432 | 538 | 543 | const XMLCh* typeNameStr = typeDef->getName(); | |
433 | 539 | GENV_ITEMFACTORY->createQName(typeName, | 544 | const XMLCh* typeUri = typeDef->getNamespace(); |
434 | 540 | StrX(typeUri).localForm(), | 545 | |
435 | 541 | "", | 546 | GENV_ITEMFACTORY->createQName(typeName, |
436 | 542 | StrX(typeNameStr).localForm()); | 547 | StrX(typeUri).localForm(), |
437 | 543 | } | 548 | "", |
438 | 544 | 549 | StrX(typeNameStr).localForm()); | |
439 | 545 | 550 | ||
440 | 546 | /******************************************************************************* | 551 | nillable = decl->getNillable(); |
441 | 547 | For a given global attribute find out its declared schema type | 552 | } |
442 | 548 | *******************************************************************************/ | 553 | |
443 | 549 | void Schema::getTypeNameFromAttributeName( | 554 | |
444 | 550 | const store::Item* qname, | 555 | /******************************************************************************* |
445 | 551 | store::Item_t& typeName, | 556 | Find a global element declaration for a given element name and return an |
446 | 552 | const QueryLoc& loc) | 557 | XQType for the associated schema type and whether the element can be nillable. |
447 | 553 | { | 558 | Raise an error if the raiseErrors param is true and no global element |
448 | 554 | XSTypeDefinition* typeDef = getTypeDefForAttribute(qname); | 559 | declaration is found for the given name. |
449 | 555 | 560 | *******************************************************************************/ | |
450 | 556 | if (!typeDef) | 561 | xqtref_t Schema::createXQTypeFromGlobalElementDecl( |
410 | 557 | { | ||
411 | 558 | RAISE_ERROR(err::XPST0008, loc, | ||
412 | 559 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); | ||
413 | 560 | } | ||
414 | 561 | |||
415 | 562 | const XMLCh* typeNameStr = typeDef->getName(); | ||
416 | 563 | const XMLCh* typeUri = typeDef->getNamespace(); | ||
417 | 564 | |||
418 | 565 | GENV_ITEMFACTORY->createQName(typeName, | ||
419 | 566 | StrX(typeUri).localForm(), | ||
420 | 567 | "", | ||
421 | 568 | StrX(typeNameStr).localForm()); | ||
422 | 569 | } | ||
423 | 570 | |||
424 | 571 | |||
425 | 572 | /******************************************************************************* | ||
426 | 573 | Returns an XQType for a global schema element definition if defined, | ||
427 | 574 | otherwise NULL | ||
428 | 575 | *******************************************************************************/ | ||
429 | 576 | xqtref_t Schema::createXQTypeFromElementName( | ||
451 | 577 | const TypeManager* typeManager, | 562 | const TypeManager* typeManager, |
452 | 578 | const store::Item* qname, | 563 | const store::Item* qname, |
454 | 579 | const bool riseErrors, | 564 | const bool raiseErrors, |
455 | 565 | bool& nillable, | ||
456 | 580 | const QueryLoc& loc) | 566 | const QueryLoc& loc) |
457 | 581 | { | 567 | { |
458 | 582 | TRACE("qn:" << qname->getLocalName() << " @ " << | 568 | TRACE("qn:" << qname->getLocalName() << " @ " << |
459 | 583 | qname->getNamespace() ); | 569 | qname->getNamespace() ); |
460 | 584 | 570 | ||
462 | 585 | XSTypeDefinition* typeDef = getTypeDefForElement(qname); | 571 | XSElementDeclaration* decl = getDeclForElement(qname); |
463 | 586 | 572 | ||
465 | 587 | if (!riseErrors && !typeDef) | 573 | if (!raiseErrors && !decl) |
466 | 588 | return NULL; | 574 | return NULL; |
467 | 589 | 575 | ||
469 | 590 | if (!typeDef) | 576 | if (!decl) |
470 | 591 | { | 577 | { |
471 | 592 | RAISE_ERROR(err::XPST0008, loc, | 578 | RAISE_ERROR(err::XPST0008, loc, |
472 | 593 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); | 579 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); |
473 | 594 | } | 580 | } |
474 | 595 | 581 | ||
475 | 582 | nillable = decl->getNillable(); | ||
476 | 583 | |||
477 | 584 | XSTypeDefinition* typeDef = decl->getTypeDefinition(); | ||
478 | 585 | |||
479 | 596 | xqtref_t res = createXQTypeFromTypeDefinition(typeManager, typeDef); | 586 | xqtref_t res = createXQTypeFromTypeDefinition(typeManager, typeDef); |
480 | 587 | |||
481 | 597 | TRACE("res:" << res->get_qname()->getLocalName() << " @ " << | 588 | TRACE("res:" << res->get_qname()->getLocalName() << " @ " << |
482 | 598 | res->get_qname()->getNamespace()); | 589 | res->get_qname()->getNamespace()); |
483 | 599 | 590 | ||
484 | @@ -602,18 +593,46 @@ | |||
485 | 602 | 593 | ||
486 | 603 | 594 | ||
487 | 604 | /******************************************************************************* | 595 | /******************************************************************************* |
488 | 596 | Find a global attribute declaration for a given attribute name and return the | ||
489 | 597 | name of the associated schema type. Raise an error if no global attribute | ||
490 | 598 | declaration is found for the given name. | ||
491 | 599 | *******************************************************************************/ | ||
492 | 600 | void Schema::getInfoFromGlobalAttributeDecl( | ||
493 | 601 | const store::Item* qname, | ||
494 | 602 | store::Item_t& typeName, | ||
495 | 603 | const QueryLoc& loc) | ||
496 | 604 | { | ||
497 | 605 | XSTypeDefinition* typeDef = getTypeDefForAttribute(qname); | ||
498 | 606 | |||
499 | 607 | if (!typeDef) | ||
500 | 608 | { | ||
501 | 609 | RAISE_ERROR(err::XPST0008, loc, | ||
502 | 610 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); | ||
503 | 611 | } | ||
504 | 612 | |||
505 | 613 | const XMLCh* typeNameStr = typeDef->getName(); | ||
506 | 614 | const XMLCh* typeUri = typeDef->getNamespace(); | ||
507 | 615 | |||
508 | 616 | GENV_ITEMFACTORY->createQName(typeName, | ||
509 | 617 | StrX(typeUri).localForm(), | ||
510 | 618 | "", | ||
511 | 619 | StrX(typeNameStr).localForm()); | ||
512 | 620 | } | ||
513 | 621 | |||
514 | 622 | |||
515 | 623 | /******************************************************************************* | ||
516 | 605 | Returns an XQType for a global schema attribute definition if defined, | 624 | Returns an XQType for a global schema attribute definition if defined, |
517 | 606 | otherwise NULL | 625 | otherwise NULL |
518 | 607 | *******************************************************************************/ | 626 | *******************************************************************************/ |
520 | 608 | xqtref_t Schema::createXQTypeFromAttributeName( | 627 | xqtref_t Schema::createXQTypeFromGlobalAttributeDecl( |
521 | 609 | const TypeManager* typeManager, | 628 | const TypeManager* typeManager, |
522 | 610 | const store::Item* qname, | 629 | const store::Item* qname, |
524 | 611 | const bool riseErrors, | 630 | const bool raiseErrors, |
525 | 612 | const QueryLoc& loc) | 631 | const QueryLoc& loc) |
526 | 613 | { | 632 | { |
527 | 614 | XSTypeDefinition* typeDef = getTypeDefForAttribute(qname); | 633 | XSTypeDefinition* typeDef = getTypeDefForAttribute(qname); |
528 | 615 | 634 | ||
530 | 616 | if (!riseErrors && !typeDef) | 635 | if (!raiseErrors && !typeDef) |
531 | 617 | return NULL; | 636 | return NULL; |
532 | 618 | 637 | ||
533 | 619 | if (!typeDef) | 638 | if (!typeDef) |
534 | @@ -744,12 +763,10 @@ | |||
535 | 744 | 763 | ||
536 | 745 | 764 | ||
537 | 746 | /******************************************************************************* | 765 | /******************************************************************************* |
539 | 747 | Get the type definition for a globally declared element | 766 | Get the declaration for a globally declared element |
540 | 748 | *******************************************************************************/ | 767 | *******************************************************************************/ |
542 | 749 | XSTypeDefinition* Schema::getTypeDefForElement(const store::Item* qname) | 768 | XSElementDeclaration* Schema::getDeclForElement(const store::Item* qname) |
543 | 750 | { | 769 | { |
544 | 751 | XSTypeDefinition* typeDef = NULL; | ||
545 | 752 | |||
546 | 753 | TRACE(" element qname: " << qname->getLocalName() << "@" << | 770 | TRACE(" element qname: " << qname->getLocalName() << "@" << |
547 | 754 | qname->getNamespace()); | 771 | qname->getNamespace()); |
548 | 755 | 772 | ||
549 | @@ -762,25 +779,7 @@ | |||
550 | 762 | bool xsModelWasChanged; | 779 | bool xsModelWasChanged; |
551 | 763 | XSModel* model = theGrammarPool->getXSModel(xsModelWasChanged); | 780 | XSModel* model = theGrammarPool->getXSModel(xsModelWasChanged); |
552 | 764 | 781 | ||
572 | 765 | XSElementDeclaration* decl = model->getElementDeclaration(local, uri); | 782 | return model->getElementDeclaration(local, uri); |
554 | 766 | |||
555 | 767 | if (decl) | ||
556 | 768 | { | ||
557 | 769 | typeDef = decl->getTypeDefinition(); | ||
558 | 770 | |||
559 | 771 | // this works only on the element that is a substitution, | ||
560 | 772 | // not on substitution base element | ||
561 | 773 | //XSElementDeclaration * substGroup = | ||
562 | 774 | // decl->getSubstitutionGroupAffiliation(); | ||
563 | 775 | |||
564 | 776 | //if ( substGroup ) | ||
565 | 777 | //{ | ||
566 | 778 | // TRACE(" substitutionGroup qname: " << StrX(substGroup->getName()) << | ||
567 | 779 | // "@" << StrX(substGroup->getNamespace()) << "\n"); | ||
568 | 780 | //} | ||
569 | 781 | } | ||
570 | 782 | |||
571 | 783 | return typeDef; | ||
573 | 784 | } | 783 | } |
574 | 785 | 784 | ||
575 | 786 | 785 | ||
576 | @@ -868,6 +867,7 @@ | |||
577 | 868 | xqtref_t baseXQType = createXQTypeFromTypeDefinition(tm, baseTypeDef); | 867 | xqtref_t baseXQType = createXQTypeFromTypeDefinition(tm, baseTypeDef); |
578 | 869 | 868 | ||
579 | 870 | xqtref_t xqType = new UserDefinedXQType(tm, | 869 | xqtref_t xqType = new UserDefinedXQType(tm, |
580 | 870 | xsTypeDef->getAnonymous(), | ||
581 | 871 | qname, | 871 | qname, |
582 | 872 | baseXQType, | 872 | baseXQType, |
583 | 873 | TypeConstants::QUANT_ONE, | 873 | TypeConstants::QUANT_ONE, |
584 | @@ -903,6 +903,7 @@ | |||
585 | 903 | // << endl; cout.flush(); | 903 | // << endl; cout.flush(); |
586 | 904 | 904 | ||
587 | 905 | xqtref_t xqType = new UserDefinedXQType(tm, | 905 | xqtref_t xqType = new UserDefinedXQType(tm, |
588 | 906 | xsTypeDef->getAnonymous(), | ||
589 | 906 | qname, | 907 | qname, |
590 | 907 | NULL, | 908 | NULL, |
591 | 908 | itemXQType.getp()); | 909 | itemXQType.getp()); |
592 | @@ -958,6 +959,7 @@ | |||
593 | 958 | //std::cout << std::endl; std::cout.flush(); | 959 | //std::cout << std::endl; std::cout.flush(); |
594 | 959 | 960 | ||
595 | 960 | xqtref_t xqType = new UserDefinedXQType(tm, | 961 | xqtref_t xqType = new UserDefinedXQType(tm, |
596 | 962 | xsTypeDef->getAnonymous(), | ||
597 | 961 | qname, | 963 | qname, |
598 | 962 | baseXQType, | 964 | baseXQType, |
599 | 963 | TypeConstants::QUANT_ONE, | 965 | TypeConstants::QUANT_ONE, |
600 | @@ -1059,6 +1061,7 @@ | |||
601 | 1059 | } | 1061 | } |
602 | 1060 | 1062 | ||
603 | 1061 | xqtref_t xqType = new UserDefinedXQType(tm, | 1063 | xqtref_t xqType = new UserDefinedXQType(tm, |
604 | 1064 | xsTypeDef->getAnonymous(), | ||
605 | 1062 | qname, | 1065 | qname, |
606 | 1063 | baseXQType, | 1066 | baseXQType, |
607 | 1064 | TypeConstants::QUANT_ONE, | 1067 | TypeConstants::QUANT_ONE, |
608 | @@ -1310,9 +1313,10 @@ | |||
609 | 1310 | bool xsModelWasChanged; | 1313 | bool xsModelWasChanged; |
610 | 1311 | XSModel* model = theGrammarPool->getXSModel(xsModelWasChanged); | 1314 | XSModel* model = theGrammarPool->getXSModel(xsModelWasChanged); |
611 | 1312 | 1315 | ||
615 | 1313 | XSNamedMap<XSObject> * typeDefs = | 1316 | XSNamedMap<XSObject>* typeDefs = |
616 | 1314 | model->getComponents(XSConstants::TYPE_DEFINITION); | 1317 | model->getComponents(XSConstants::TYPE_DEFINITION); |
617 | 1315 | for( uint i = 0; i<typeDefs->getLength(); i++) | 1318 | |
618 | 1319 | for( uint i = 0; i < typeDefs->getLength(); i++) | ||
619 | 1316 | { | 1320 | { |
620 | 1317 | XSTypeDefinition* typeDef = (XSTypeDefinition*)(typeDefs->item(i)); | 1321 | XSTypeDefinition* typeDef = (XSTypeDefinition*)(typeDefs->item(i)); |
621 | 1318 | checkForAnonymousTypesInType(typeManager, typeDef); | 1322 | checkForAnonymousTypesInType(typeManager, typeDef); |
622 | @@ -1529,6 +1533,7 @@ | |||
623 | 1529 | 1533 | ||
624 | 1530 | xqtref_t xqType = | 1534 | xqtref_t xqType = |
625 | 1531 | xqtref_t(new UserDefinedXQType(typeManager, | 1535 | xqtref_t(new UserDefinedXQType(typeManager, |
626 | 1536 | xsTypeDef->getAnonymous(), | ||
627 | 1532 | qname, | 1537 | qname, |
628 | 1533 | baseXQType, | 1538 | baseXQType, |
629 | 1534 | TypeConstants::QUANT_ONE, | 1539 | TypeConstants::QUANT_ONE, |
630 | 1535 | 1540 | ||
631 | === modified file 'src/types/schema/schema.h' | |||
632 | --- src/types/schema/schema.h 2013-02-07 17:24:36 +0000 | |||
633 | +++ src/types/schema/schema.h 2013-04-30 21:00:38 +0000 | |||
634 | @@ -43,6 +43,7 @@ | |||
635 | 43 | namespace XERCES_CPP_NAMESPACE { | 43 | namespace XERCES_CPP_NAMESPACE { |
636 | 44 | class InputSource; | 44 | class InputSource; |
637 | 45 | class XSTypeDefinition; | 45 | class XSTypeDefinition; |
638 | 46 | class XSElementDeclaration; | ||
639 | 46 | class XSParticle; | 47 | class XSParticle; |
640 | 47 | class XMLGrammarPool; | 48 | class XMLGrammarPool; |
641 | 48 | } | 49 | } |
642 | @@ -106,31 +107,33 @@ | |||
643 | 106 | 107 | ||
644 | 107 | void registerXSD( | 108 | void registerXSD( |
645 | 108 | const char* xsdURL, | 109 | const char* xsdURL, |
648 | 109 | static_context * aSctx, | 110 | static_context* sctx, |
649 | 110 | internal::StreamResource* aStreamResource, | 111 | internal::StreamResource* streamResource, |
650 | 111 | const QueryLoc& loc); | 112 | const QueryLoc& loc); |
651 | 112 | 113 | ||
652 | 113 | void getSubstitutionHeadForElement( | 114 | void getSubstitutionHeadForElement( |
653 | 114 | const store::Item* qname, | 115 | const store::Item* qname, |
654 | 115 | store::Item_t& result); | 116 | store::Item_t& result); |
655 | 116 | 117 | ||
667 | 117 | void getTypeNameFromElementName( | 118 | void getInfoFromGlobalElementDecl( |
668 | 118 | const store::Item* qname, | 119 | const store::Item* qname, |
669 | 119 | store::Item_t& typeName, | 120 | store::Item_t& typeName, |
670 | 120 | const QueryLoc& loc); | 121 | bool& nillable, |
671 | 121 | 122 | const QueryLoc& loc); | |
672 | 122 | void getTypeNameFromAttributeName( | 123 | |
673 | 123 | const store::Item* qname, | 124 | xqtref_t createXQTypeFromGlobalElementDecl( |
663 | 124 | store::Item_t& typeName, | ||
664 | 125 | const QueryLoc& loc); | ||
665 | 126 | |||
666 | 127 | xqtref_t createXQTypeFromElementName( | ||
674 | 128 | const TypeManager* typeManager, | 125 | const TypeManager* typeManager, |
675 | 129 | const store::Item* qname, | 126 | const store::Item* qname, |
680 | 130 | const bool riseErrors, | 127 | const bool raiseErrors, |
681 | 131 | const QueryLoc& loc); | 128 | bool& nillable, |
682 | 132 | 129 | const QueryLoc& loc); | |
683 | 133 | xqtref_t createXQTypeFromAttributeName( | 130 | |
684 | 131 | void getInfoFromGlobalAttributeDecl( | ||
685 | 132 | const store::Item* qname, | ||
686 | 133 | store::Item_t& typeName, | ||
687 | 134 | const QueryLoc& loc); | ||
688 | 135 | |||
689 | 136 | xqtref_t createXQTypeFromGlobalAttributeDecl( | ||
690 | 134 | const TypeManager* typeManager, | 137 | const TypeManager* typeManager, |
691 | 135 | const store::Item* qname, | 138 | const store::Item* qname, |
692 | 136 | const bool riseErrors, | 139 | const bool riseErrors, |
693 | @@ -194,11 +197,11 @@ | |||
694 | 194 | private: | 197 | private: |
695 | 195 | 198 | ||
696 | 196 | #ifndef ZORBA_NO_XMLSCHEMA | 199 | #ifndef ZORBA_NO_XMLSCHEMA |
699 | 197 | XERCES_CPP_NAMESPACE::XSTypeDefinition* | 200 | XERCES_CPP_NAMESPACE::XSElementDeclaration* getDeclForElement( |
700 | 198 | getTypeDefForElement(const store::Item* qname); | 201 | const store::Item* qname); |
701 | 199 | 202 | ||
704 | 200 | XERCES_CPP_NAMESPACE::XSTypeDefinition* | 203 | XERCES_CPP_NAMESPACE::XSTypeDefinition* getTypeDefForAttribute( |
705 | 201 | getTypeDefForAttribute(const store::Item* qname); | 204 | const store::Item* qname); |
706 | 202 | 205 | ||
707 | 203 | xqtref_t createXQTypeFromTypeDefinition( | 206 | xqtref_t createXQTypeFromTypeDefinition( |
708 | 204 | const TypeManager* typeManager, | 207 | const TypeManager* typeManager, |
709 | 205 | 208 | ||
710 | === modified file 'src/types/schema/validate.cpp' | |||
711 | --- src/types/schema/validate.cpp 2013-02-07 17:24:36 +0000 | |||
712 | +++ src/types/schema/validate.cpp 2013-04-30 21:00:38 +0000 | |||
713 | @@ -193,20 +193,22 @@ | |||
714 | 193 | { | 193 | { |
715 | 194 | schemaValidator.startDoc(); | 194 | schemaValidator.startDoc(); |
716 | 195 | 195 | ||
717 | 196 | // ask for the type of the root element to populate | ||
718 | 197 | // the cache with anonymous types | ||
719 | 198 | store::Iterator_t children = sourceNode->getChildren(); | 196 | store::Iterator_t children = sourceNode->getChildren(); |
720 | 199 | store::Item_t child; | 197 | store::Item_t child; |
721 | 200 | while ( children->next(child) ) | 198 | while ( children->next(child) ) |
722 | 201 | { | 199 | { |
723 | 200 | // ask for the type of the element. We don't really need this type here, | ||
724 | 201 | // but a side-effect of this call is to add the type to the cache. | ||
725 | 202 | if ( child->isNode() && | 202 | if ( child->isNode() && |
726 | 203 | child->getNodeKind()==store::StoreConsts::elementNode ) | 203 | child->getNodeKind()==store::StoreConsts::elementNode ) |
727 | 204 | { | 204 | { |
728 | 205 | bool nillable; | ||
729 | 205 | typeManager->getSchema()-> | 206 | typeManager->getSchema()-> |
734 | 206 | createXQTypeFromElementName(typeManager, | 207 | createXQTypeFromGlobalElementDecl(typeManager, |
735 | 207 | child->getNodeName(), | 208 | child->getNodeName(), |
736 | 208 | false, | 209 | false, |
737 | 209 | loc); | 210 | nillable, |
738 | 211 | loc); | ||
739 | 210 | break; | 212 | break; |
740 | 211 | } | 213 | } |
741 | 212 | } | 214 | } |
742 | @@ -259,13 +261,15 @@ | |||
743 | 259 | //cout << "Validate element" << "\n"; cout.flush(); | 261 | //cout << "Validate element" << "\n"; cout.flush(); |
744 | 260 | schemaValidator.startDoc(); | 262 | schemaValidator.startDoc(); |
745 | 261 | 263 | ||
748 | 262 | // ask for the type of the root element to populate the cache | 264 | // ask for the type of the element. We don't really need this type here, |
749 | 263 | // with anonymous types | 265 | // but a side-effect of this call is to add the type to the cache. |
750 | 266 | bool nillable; | ||
751 | 264 | typeManager->getSchema()-> | 267 | typeManager->getSchema()-> |
756 | 265 | createXQTypeFromElementName(typeManager, | 268 | createXQTypeFromGlobalElementDecl(typeManager, |
757 | 266 | sourceNode->getNodeName(), | 269 | sourceNode->getNodeName(), |
758 | 267 | false, | 270 | false, |
759 | 268 | loc); | 271 | nillable, |
760 | 272 | loc); | ||
761 | 269 | } | 273 | } |
762 | 270 | 274 | ||
763 | 271 | store::Item_t newElem = processElement(sctx, | 275 | store::Item_t newElem = processElement(sctx, |
764 | 272 | 276 | ||
765 | === modified file 'src/types/typeimpl.cpp' | |||
766 | --- src/types/typeimpl.cpp 2013-03-22 00:38:18 +0000 | |||
767 | +++ src/types/typeimpl.cpp 2013-04-30 21:00:38 +0000 | |||
768 | @@ -29,6 +29,7 @@ | |||
769 | 29 | #include "zorbaserialization/serialize_template_types.h" | 29 | #include "zorbaserialization/serialize_template_types.h" |
770 | 30 | #include "zorbaserialization/serialize_zorba_types.h" | 30 | #include "zorbaserialization/serialize_zorba_types.h" |
771 | 31 | 31 | ||
772 | 32 | #include "store/api/iterator.h" | ||
773 | 32 | 33 | ||
774 | 33 | namespace zorba | 34 | namespace zorba |
775 | 34 | { | 35 | { |
776 | @@ -718,11 +719,11 @@ | |||
777 | 718 | bool builtin) | 719 | bool builtin) |
778 | 719 | : | 720 | : |
779 | 720 | XQType(manager, NODE_TYPE_KIND, quantifier, builtin), | 721 | XQType(manager, NODE_TYPE_KIND, quantifier, builtin), |
782 | 721 | m_node_kind(nodeKind), | 722 | theNodeKind(nodeKind), |
783 | 722 | m_node_name(nodeName), | 723 | theNodeName(nodeName), |
784 | 723 | theContentType(contentType), | 724 | theContentType(contentType), |
787 | 724 | m_nillable(nillable), | 725 | theNillable(nillable), |
788 | 725 | m_schema_test(schematest) | 726 | theIsSchemaTest(schematest) |
789 | 726 | { | 727 | { |
790 | 727 | assert(contentType == NULL || | 728 | assert(contentType == NULL || |
791 | 728 | (nodeKind == store::StoreConsts::documentNode && | 729 | (nodeKind == store::StoreConsts::documentNode && |
792 | @@ -754,11 +755,11 @@ | |||
793 | 754 | TypeConstants::quantifier_t quantifier) | 755 | TypeConstants::quantifier_t quantifier) |
794 | 755 | : | 756 | : |
795 | 756 | XQType(source.theManager, NODE_TYPE_KIND, quantifier, false), | 757 | XQType(source.theManager, NODE_TYPE_KIND, quantifier, false), |
798 | 757 | m_node_kind(source.m_node_kind), | 758 | theNodeKind(source.theNodeKind), |
799 | 758 | m_node_name(source.m_node_name), | 759 | theNodeName(source.theNodeName), |
800 | 759 | theContentType(source.theContentType), | 760 | theContentType(source.theContentType), |
803 | 760 | m_nillable(source.m_nillable), | 761 | theNillable(source.theNillable), |
804 | 761 | m_schema_test(source.m_schema_test) | 762 | theIsSchemaTest(source.theIsSchemaTest) |
805 | 762 | { | 763 | { |
806 | 763 | } | 764 | } |
807 | 764 | 765 | ||
808 | @@ -769,11 +770,11 @@ | |||
809 | 769 | void NodeXQType::serialize(::zorba::serialization::Archiver& ar) | 770 | void NodeXQType::serialize(::zorba::serialization::Archiver& ar) |
810 | 770 | { | 771 | { |
811 | 771 | serialize_baseclass(ar, (XQType*)this); | 772 | serialize_baseclass(ar, (XQType*)this); |
814 | 772 | SERIALIZE_ENUM(store::StoreConsts::NodeKind, m_node_kind); | 773 | SERIALIZE_ENUM(store::StoreConsts::NodeKind, theNodeKind); |
815 | 773 | ar & m_node_name; | 774 | ar & theNodeName; |
816 | 774 | ar & theContentType; | 775 | ar & theContentType; |
819 | 775 | ar & m_nillable; | 776 | ar & theNillable; |
820 | 776 | ar & m_schema_test; | 777 | ar & theIsSchemaTest; |
821 | 777 | } | 778 | } |
822 | 778 | 779 | ||
823 | 779 | 780 | ||
824 | @@ -791,15 +792,15 @@ | |||
825 | 791 | ********************************************************************************/ | 792 | ********************************************************************************/ |
826 | 792 | bool NodeXQType::is_equal(const TypeManager* tm, const NodeXQType& other) const | 793 | bool NodeXQType::is_equal(const TypeManager* tm, const NodeXQType& other) const |
827 | 793 | { | 794 | { |
829 | 794 | if (m_node_kind != other.m_node_kind) | 795 | if (theNodeKind != other.theNodeKind) |
830 | 795 | return false; | 796 | return false; |
831 | 796 | 797 | ||
833 | 797 | if (m_node_name != other.m_node_name) | 798 | if (theNodeName != other.theNodeName) |
834 | 798 | { | 799 | { |
836 | 799 | if (m_node_name == NULL || other.m_node_name == NULL) | 800 | if (theNodeName == NULL || other.theNodeName == NULL) |
837 | 800 | return false; | 801 | return false; |
838 | 801 | 802 | ||
840 | 802 | if (!m_node_name->equals(other.m_node_name)) | 803 | if (!theNodeName->equals(other.theNodeName)) |
841 | 803 | return false; | 804 | return false; |
842 | 804 | } | 805 | } |
843 | 805 | 806 | ||
844 | @@ -829,7 +830,7 @@ | |||
845 | 829 | const NodeXQType& supertype, | 830 | const NodeXQType& supertype, |
846 | 830 | const QueryLoc& loc) const | 831 | const QueryLoc& loc) const |
847 | 831 | { | 832 | { |
849 | 832 | if (supertype.m_node_kind == store::StoreConsts::anyNode) | 833 | if (supertype.theNodeKind == store::StoreConsts::anyNode) |
850 | 833 | { | 834 | { |
851 | 834 | if (supertype.theContentType != NULL && | 835 | if (supertype.theContentType != NULL && |
852 | 835 | supertype.theContentType->type_kind() == XQType::UNTYPED_KIND) | 836 | supertype.theContentType->type_kind() == XQType::UNTYPED_KIND) |
853 | @@ -841,17 +842,17 @@ | |||
854 | 841 | return true; | 842 | return true; |
855 | 842 | } | 843 | } |
856 | 843 | 844 | ||
858 | 844 | if (supertype.m_node_kind != m_node_kind) | 845 | if (supertype.theNodeKind != theNodeKind) |
859 | 845 | return false; | 846 | return false; |
860 | 846 | 847 | ||
862 | 847 | if (supertype.m_node_name != NULL) | 848 | if (supertype.theNodeName != NULL) |
863 | 848 | { | 849 | { |
865 | 849 | if (m_node_name == NULL) | 850 | if (theNodeName == NULL) |
866 | 850 | return false; | 851 | return false; |
867 | 851 | 852 | ||
869 | 852 | if (!m_node_name->equals(supertype.m_node_name)) | 853 | if (!theNodeName->equals(supertype.theNodeName)) |
870 | 853 | { | 854 | { |
872 | 854 | if (supertype.m_schema_test) | 855 | if (supertype.theIsSchemaTest) |
873 | 855 | { | 856 | { |
874 | 856 | Schema* schema = supertype.theManager->getSchema(); | 857 | Schema* schema = supertype.theManager->getSchema(); |
875 | 857 | ZORBA_ASSERT(schema != NULL); | 858 | ZORBA_ASSERT(schema != NULL); |
876 | @@ -859,11 +860,11 @@ | |||
877 | 859 | store::Item_t headName; | 860 | store::Item_t headName; |
878 | 860 | 861 | ||
879 | 861 | #ifndef ZORBA_NO_XMLSCHEMA | 862 | #ifndef ZORBA_NO_XMLSCHEMA |
881 | 862 | schema->getSubstitutionHeadForElement(m_node_name.getp(), headName); | 863 | schema->getSubstitutionHeadForElement(theNodeName.getp(), headName); |
882 | 863 | 864 | ||
883 | 864 | while (headName != NULL) | 865 | while (headName != NULL) |
884 | 865 | { | 866 | { |
886 | 866 | if (headName->equals(supertype.m_node_name)) | 867 | if (headName->equals(supertype.theNodeName)) |
887 | 867 | { | 868 | { |
888 | 868 | break; | 869 | break; |
889 | 869 | } | 870 | } |
890 | @@ -883,10 +884,18 @@ | |||
891 | 883 | } | 884 | } |
892 | 884 | 885 | ||
893 | 885 | if (theContentType == supertype.theContentType) | 886 | if (theContentType == supertype.theContentType) |
894 | 887 | { | ||
895 | 888 | if (supertype.theNillable == false && theNillable == true) | ||
896 | 889 | return false; | ||
897 | 890 | |||
898 | 886 | return true; | 891 | return true; |
899 | 892 | } | ||
900 | 887 | 893 | ||
901 | 888 | if (theContentType != NULL && supertype.theContentType != NULL) | 894 | if (theContentType != NULL && supertype.theContentType != NULL) |
902 | 889 | { | 895 | { |
903 | 896 | if (supertype.theNillable == false && theNillable == true) | ||
904 | 897 | return false; | ||
905 | 898 | |||
906 | 890 | return TypeOps::is_subtype(tm, *theContentType, *supertype.theContentType); | 899 | return TypeOps::is_subtype(tm, *theContentType, *supertype.theContentType); |
907 | 891 | } | 900 | } |
908 | 892 | else if (supertype.theContentType == NULL) | 901 | else if (supertype.theContentType == NULL) |
909 | @@ -912,7 +921,7 @@ | |||
910 | 912 | { | 921 | { |
911 | 913 | assert(subitem->isNode()); | 922 | assert(subitem->isNode()); |
912 | 914 | 923 | ||
914 | 915 | if (m_node_kind == store::StoreConsts::anyNode) | 924 | if (theNodeKind == store::StoreConsts::anyNode) |
915 | 916 | { | 925 | { |
916 | 917 | if (theContentType != NULL && | 926 | if (theContentType != NULL && |
917 | 918 | theContentType->type_kind() == XQType::UNTYPED_KIND) | 927 | theContentType->type_kind() == XQType::UNTYPED_KIND) |
918 | @@ -923,74 +932,152 @@ | |||
919 | 923 | return true; | 932 | return true; |
920 | 924 | } | 933 | } |
921 | 925 | 934 | ||
923 | 926 | if (m_node_kind != subitem->getNodeKind()) | 935 | if (theNodeKind != subitem->getNodeKind()) |
924 | 927 | return false; | 936 | return false; |
925 | 928 | 937 | ||
931 | 929 | if (m_node_name != NULL) | 938 | switch (theNodeKind) |
932 | 930 | { | 939 | { |
933 | 931 | if (!subitem->getNodeName()->equals(m_node_name)) | 940 | case store::StoreConsts::textNode: |
934 | 932 | { | 941 | case store::StoreConsts::commentNode: |
935 | 933 | if (m_schema_test) | 942 | case store::StoreConsts::namespaceNode: |
936 | 943 | { | ||
937 | 944 | return true; | ||
938 | 945 | } | ||
939 | 946 | case store::StoreConsts::piNode: | ||
940 | 947 | { | ||
941 | 948 | if (theNodeName != NULL && !subitem->getNodeName()->equals(theNodeName)) | ||
942 | 949 | return false; | ||
943 | 950 | |||
944 | 951 | return true; | ||
945 | 952 | } | ||
946 | 953 | case store::StoreConsts::attributeNode: | ||
947 | 954 | { | ||
948 | 955 | assert(!theIsSchemaTest || (theNodeName && theContentType)); | ||
949 | 956 | |||
950 | 957 | if (theNodeName != NULL && !subitem->getNodeName()->equals(theNodeName)) | ||
951 | 958 | return false; | ||
952 | 959 | |||
953 | 960 | if (theContentType != NULL) | ||
954 | 961 | { | ||
955 | 962 | xqtref_t subContentType = | ||
956 | 963 | tm->create_named_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, true); | ||
957 | 964 | |||
958 | 965 | return TypeOps::is_subtype(tm, *subContentType, *theContentType); | ||
959 | 966 | } | ||
960 | 967 | |||
961 | 968 | return true; | ||
962 | 969 | } | ||
963 | 970 | case store::StoreConsts::elementNode: | ||
964 | 971 | { | ||
965 | 972 | if (theIsSchemaTest) | ||
966 | 973 | { | ||
967 | 974 | assert(theNodeName != NULL); | ||
968 | 975 | |||
969 | 976 | if (!subitem->getNodeName()->equals(theNodeName)) | ||
970 | 934 | { | 977 | { |
971 | 935 | Schema* schema = theManager->getSchema(); | 978 | Schema* schema = theManager->getSchema(); |
972 | 936 | ZORBA_ASSERT(schema != NULL); | 979 | ZORBA_ASSERT(schema != NULL); |
974 | 937 | 980 | ||
975 | 938 | store::Item_t headName; | 981 | store::Item_t headName; |
977 | 939 | 982 | ||
978 | 940 | #ifndef ZORBA_NO_XMLSCHEMA | 983 | #ifndef ZORBA_NO_XMLSCHEMA |
979 | 941 | schema->getSubstitutionHeadForElement(subitem->getNodeName(), headName); | 984 | schema->getSubstitutionHeadForElement(subitem->getNodeName(), headName); |
981 | 942 | 985 | ||
982 | 943 | while (headName != NULL) | 986 | while (headName != NULL) |
983 | 944 | { | 987 | { |
986 | 945 | if (headName->equals(m_node_name)) | 988 | if (headName->equals(theNodeName)) |
985 | 946 | { | ||
987 | 947 | break; | 989 | break; |
990 | 948 | } | 990 | |
989 | 949 | |||
991 | 950 | schema->getSubstitutionHeadForElement(headName.getp(), headName); | 991 | schema->getSubstitutionHeadForElement(headName.getp(), headName); |
992 | 951 | } | 992 | } |
993 | 952 | #endif // ZORBA_NO_XMLSCHEMA | 993 | #endif // ZORBA_NO_XMLSCHEMA |
995 | 953 | 994 | ||
996 | 954 | if (headName == NULL) | 995 | if (headName == NULL) |
997 | 955 | return false; | 996 | return false; |
998 | 956 | } | 997 | } |
1000 | 957 | else | 998 | |
1001 | 999 | if (theContentType == NULL || | ||
1002 | 1000 | theContentType->type_kind() == XQType::ANY_TYPE_KIND) | ||
1003 | 1001 | return true; | ||
1004 | 1002 | |||
1005 | 1003 | xqtref_t subContentType = tm->create_named_type(subitem->getType(), | ||
1006 | 1004 | TypeConstants::QUANT_ONE, | ||
1007 | 1005 | loc, | ||
1008 | 1006 | true); | ||
1009 | 1007 | |||
1010 | 1008 | if (!TypeOps::is_subtype(tm, *subContentType, *theContentType)) | ||
1011 | 1009 | return false; | ||
1012 | 1010 | |||
1013 | 1011 | bool nillable; | ||
1014 | 1012 | store::Item_t typeName; | ||
1015 | 1013 | tm->get_schema_element_typeinfo(subitem->getNodeName(), typeName, nillable, loc); | ||
1016 | 1014 | |||
1017 | 1015 | if (!nillable && subitem->getNilled()) | ||
1018 | 1016 | return false; | ||
1019 | 1017 | |||
1020 | 1018 | return true; | ||
1021 | 1019 | } | ||
1022 | 1020 | else | ||
1023 | 1021 | { | ||
1024 | 1022 | if (theNodeName != NULL && !subitem->getNodeName()->equals(theNodeName)) | ||
1025 | 1023 | return false; | ||
1026 | 1024 | |||
1027 | 1025 | if (!theNillable && subitem->getNilled()) | ||
1028 | 1026 | return false; | ||
1029 | 1027 | |||
1030 | 1028 | if (theContentType == NULL || | ||
1031 | 1029 | theContentType->type_kind() == XQType::ANY_TYPE_KIND) | ||
1032 | 1030 | return true; | ||
1033 | 1031 | |||
1034 | 1032 | xqtref_t subContentType = | ||
1035 | 1033 | tm->create_named_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, true); | ||
1036 | 1034 | |||
1037 | 1035 | return TypeOps::is_subtype(tm, *subContentType, *theContentType); | ||
1038 | 1036 | } | ||
1039 | 1037 | } | ||
1040 | 1038 | case store::StoreConsts::documentNode: | ||
1041 | 1039 | { | ||
1042 | 1040 | if (theContentType == NULL || | ||
1043 | 1041 | theContentType->type_kind() == XQType::ANY_TYPE_KIND) | ||
1044 | 1042 | return true; | ||
1045 | 1043 | |||
1046 | 1044 | if (theContentType->type_kind() == XQType::UNTYPED_KIND) | ||
1047 | 1045 | { | ||
1048 | 1046 | return !subitem->isValidated(); | ||
1049 | 1047 | } | ||
1050 | 1048 | |||
1051 | 1049 | ZORBA_ASSERT(theContentType->type_kind() == XQType::NODE_TYPE_KIND); | ||
1052 | 1050 | |||
1053 | 1051 | store::Iterator_t childrenIte = subitem->getChildren(); | ||
1054 | 1052 | store::Item_t child; | ||
1055 | 1053 | store::Item_t elemChild; | ||
1056 | 1054 | csize numElemChildren = 0; | ||
1057 | 1055 | childrenIte->open(); | ||
1058 | 1056 | while (childrenIte->next(child)) | ||
1059 | 1057 | { | ||
1060 | 1058 | if (child->getNodeKind() == store::StoreConsts::elementNode) | ||
1061 | 958 | { | 1059 | { |
1063 | 959 | return false; | 1060 | if (numElemChildren == 0) |
1064 | 1061 | elemChild.transfer(child); | ||
1065 | 1062 | |||
1066 | 1063 | ++numElemChildren; | ||
1067 | 960 | } | 1064 | } |
1068 | 961 | } | 1065 | } |
1069 | 1066 | childrenIte->close(); | ||
1070 | 1067 | |||
1071 | 1068 | if (numElemChildren != 1) | ||
1072 | 1069 | return false; | ||
1073 | 1070 | |||
1074 | 1071 | const NodeXQType* elemTestType = | ||
1075 | 1072 | static_cast<const NodeXQType*>(theContentType.getp()); | ||
1076 | 1073 | |||
1077 | 1074 | return elemTestType->is_supertype(tm, elemChild, loc); | ||
1078 | 962 | } | 1075 | } |
1099 | 963 | 1076 | default: | |
1080 | 964 | // document-node(E) matches any document node that contains exactly one element | ||
1081 | 965 | // node, optionally accompanied by one or more comment and processing instruction | ||
1082 | 966 | // nodes, if E is an ElementTest or SchemaElementTest that matches the element node. | ||
1083 | 967 | bool is_element_test = ( | ||
1084 | 968 | m_node_kind == store::StoreConsts::documentNode && | ||
1085 | 969 | theContentType != NULL && | ||
1086 | 970 | theContentType->type_kind() == XQType::NODE_TYPE_KIND && | ||
1087 | 971 | static_cast<const NodeXQType*>(theContentType.getp())->m_schema_test == false); | ||
1088 | 972 | |||
1089 | 973 | if (m_node_kind != store::StoreConsts::elementNode && | ||
1090 | 974 | m_node_kind != store::StoreConsts::attributeNode && | ||
1091 | 975 | !is_element_test) | ||
1092 | 976 | return true; | ||
1093 | 977 | |||
1094 | 978 | if (theContentType == NULL || | ||
1095 | 979 | theContentType->type_kind() == XQType::ANY_TYPE_KIND) | ||
1096 | 980 | return true; | ||
1097 | 981 | |||
1098 | 982 | if (is_element_test) | ||
1100 | 983 | { | 1077 | { |
1111 | 984 | xqtref_t documentNodeType = tm->create_value_type(subitem, loc); | 1078 | ZORBA_ASSERT(false); |
1112 | 985 | return TypeOps::is_subtype(tm, *documentNodeType, *this); | 1079 | } |
1113 | 986 | } | 1080 | } |
1104 | 987 | |||
1105 | 988 | xqtref_t subContentType = tm->create_named_type(subitem->getType(), | ||
1106 | 989 | TypeConstants::QUANT_ONE, | ||
1107 | 990 | loc, | ||
1108 | 991 | true); | ||
1109 | 992 | |||
1110 | 993 | return TypeOps::is_subtype(tm, *subContentType, *theContentType); | ||
1114 | 994 | } | 1081 | } |
1115 | 995 | 1082 | ||
1116 | 996 | 1083 | ||
1117 | @@ -999,16 +1086,16 @@ | |||
1118 | 999 | ********************************************************************************/ | 1086 | ********************************************************************************/ |
1119 | 1000 | std::ostream& NodeXQType::serialize_ostream(std::ostream& os) const | 1087 | std::ostream& NodeXQType::serialize_ostream(std::ostream& os) const |
1120 | 1001 | { | 1088 | { |
1122 | 1002 | store::StoreConsts::NodeKind node_kind = m_node_kind; | 1089 | store::StoreConsts::NodeKind node_kind = theNodeKind; |
1123 | 1003 | xqtref_t content_type = get_content_type(); | 1090 | xqtref_t content_type = get_content_type(); |
1124 | 1004 | 1091 | ||
1125 | 1005 | os << "[NodeXQType " << store::StoreConsts::toString(node_kind) | 1092 | os << "[NodeXQType " << store::StoreConsts::toString(node_kind) |
1126 | 1006 | << TypeOps::decode_quantifier(get_quantifier()); | 1093 | << TypeOps::decode_quantifier(get_quantifier()); |
1127 | 1007 | 1094 | ||
1129 | 1008 | if (m_node_name != NULL) | 1095 | if (theNodeName != NULL) |
1130 | 1009 | { | 1096 | { |
1133 | 1010 | os << " nametest=[uri: " << m_node_name->getNamespace() | 1097 | os << " nametest=[uri: " << theNodeName->getNamespace() |
1134 | 1011 | << ", local: " << m_node_name->getLocalName() << "]"; | 1098 | << ", local: " << theNodeName->getLocalName() << "]"; |
1135 | 1012 | } | 1099 | } |
1136 | 1013 | 1100 | ||
1137 | 1014 | if (content_type != NULL) | 1101 | if (content_type != NULL) |
1138 | @@ -1025,7 +1112,7 @@ | |||
1139 | 1025 | { | 1112 | { |
1140 | 1026 | std::ostringstream os; | 1113 | std::ostringstream os; |
1141 | 1027 | 1114 | ||
1143 | 1028 | if (m_node_kind == store::StoreConsts::documentNode) | 1115 | if (theNodeKind == store::StoreConsts::documentNode) |
1144 | 1029 | { | 1116 | { |
1145 | 1030 | os << "document-node("; | 1117 | os << "document-node("; |
1146 | 1031 | 1118 | ||
1147 | @@ -1035,26 +1122,26 @@ | |||
1148 | 1035 | os << ", " << theContentType->toSchemaString(); | 1122 | os << ", " << theContentType->toSchemaString(); |
1149 | 1036 | } | 1123 | } |
1150 | 1037 | } | 1124 | } |
1152 | 1038 | else if (m_schema_test) | 1125 | else if (theIsSchemaTest) |
1153 | 1039 | { | 1126 | { |
1154 | 1040 | assert(theContentType != NULL); | 1127 | assert(theContentType != NULL); |
1155 | 1041 | 1128 | ||
1156 | 1042 | os << "schema-" << store::StoreConsts::toSchemaString(get_node_kind()) << "(" | 1129 | os << "schema-" << store::StoreConsts::toSchemaString(get_node_kind()) << "(" |
1158 | 1043 | << m_node_name->getStringValue(); | 1130 | << theNodeName->getStringValue(); |
1159 | 1044 | } | 1131 | } |
1160 | 1045 | else | 1132 | else |
1161 | 1046 | { | 1133 | { |
1162 | 1047 | os << store::StoreConsts::toSchemaString(get_node_kind()) << "("; | 1134 | os << store::StoreConsts::toSchemaString(get_node_kind()) << "("; |
1163 | 1048 | 1135 | ||
1165 | 1049 | if (m_node_name != NULL) | 1136 | if (theNodeName != NULL) |
1166 | 1050 | { | 1137 | { |
1168 | 1051 | os << m_node_name->getStringValue(); | 1138 | os << theNodeName->getStringValue(); |
1169 | 1052 | 1139 | ||
1170 | 1053 | if (theContentType != NULL) | 1140 | if (theContentType != NULL) |
1171 | 1054 | { | 1141 | { |
1172 | 1055 | os << ", " << theContentType->toSchemaString(); | 1142 | os << ", " << theContentType->toSchemaString(); |
1173 | 1056 | 1143 | ||
1175 | 1057 | if (m_nillable) | 1144 | if (theNillable) |
1176 | 1058 | os << "?"; | 1145 | os << "?"; |
1177 | 1059 | } | 1146 | } |
1178 | 1060 | } | 1147 | } |
1179 | @@ -1062,7 +1149,7 @@ | |||
1180 | 1062 | { | 1149 | { |
1181 | 1063 | os << "*, " << theContentType->toSchemaString(); | 1150 | os << "*, " << theContentType->toSchemaString(); |
1182 | 1064 | 1151 | ||
1184 | 1065 | if (m_nillable) | 1152 | if (theNillable) |
1185 | 1066 | os << "?"; | 1153 | os << "?"; |
1186 | 1067 | } | 1154 | } |
1187 | 1068 | } | 1155 | } |
1188 | @@ -1238,6 +1325,7 @@ | |||
1189 | 1238 | ********************************************************************************/ | 1325 | ********************************************************************************/ |
1190 | 1239 | UserDefinedXQType::UserDefinedXQType( | 1326 | UserDefinedXQType::UserDefinedXQType( |
1191 | 1240 | const TypeManager* manager, | 1327 | const TypeManager* manager, |
1192 | 1328 | bool isAnonymous, | ||
1193 | 1241 | store::Item_t qname, | 1329 | store::Item_t qname, |
1194 | 1242 | const xqtref_t& baseType, | 1330 | const xqtref_t& baseType, |
1195 | 1243 | TypeConstants::quantifier_t quantifier, | 1331 | TypeConstants::quantifier_t quantifier, |
1196 | @@ -1246,8 +1334,9 @@ | |||
1197 | 1246 | bool builtin) | 1334 | bool builtin) |
1198 | 1247 | : | 1335 | : |
1199 | 1248 | XQType(manager, USER_DEFINED_KIND, quantifier, builtin), | 1336 | XQType(manager, USER_DEFINED_KIND, quantifier, builtin), |
1200 | 1337 | theIsAnonymous(isAnonymous), | ||
1201 | 1249 | theQName(qname), | 1338 | theQName(qname), |
1203 | 1250 | m_baseType(baseType), | 1339 | theBaseType(baseType), |
1204 | 1251 | theUDTKind(udtKind), | 1340 | theUDTKind(udtKind), |
1205 | 1252 | m_contentKind(contentKind) | 1341 | m_contentKind(contentKind) |
1206 | 1253 | { | 1342 | { |
1207 | @@ -1267,14 +1356,16 @@ | |||
1208 | 1267 | ********************************************************************************/ | 1356 | ********************************************************************************/ |
1209 | 1268 | UserDefinedXQType::UserDefinedXQType( | 1357 | UserDefinedXQType::UserDefinedXQType( |
1210 | 1269 | const TypeManager* manager, | 1358 | const TypeManager* manager, |
1211 | 1359 | bool isAnonymous, | ||
1212 | 1270 | store::Item_t qname, | 1360 | store::Item_t qname, |
1213 | 1271 | const xqtref_t& baseType, | 1361 | const xqtref_t& baseType, |
1214 | 1272 | const XQType* listItemType, | 1362 | const XQType* listItemType, |
1215 | 1273 | bool builtin) | 1363 | bool builtin) |
1216 | 1274 | : | 1364 | : |
1217 | 1275 | XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, builtin), | 1365 | XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, builtin), |
1218 | 1366 | theIsAnonymous(isAnonymous), | ||
1219 | 1276 | theQName(qname), | 1367 | theQName(qname), |
1221 | 1277 | m_baseType(baseType), | 1368 | theBaseType(baseType), |
1222 | 1278 | theUDTKind(LIST_UDT), | 1369 | theUDTKind(LIST_UDT), |
1223 | 1279 | m_contentKind(SIMPLE_CONTENT_KIND), | 1370 | m_contentKind(SIMPLE_CONTENT_KIND), |
1224 | 1280 | m_listItemType(listItemType) | 1371 | m_listItemType(listItemType) |
1225 | @@ -1288,6 +1379,7 @@ | |||
1226 | 1288 | ********************************************************************************/ | 1379 | ********************************************************************************/ |
1227 | 1289 | UserDefinedXQType::UserDefinedXQType( | 1380 | UserDefinedXQType::UserDefinedXQType( |
1228 | 1290 | const TypeManager* manager, | 1381 | const TypeManager* manager, |
1229 | 1382 | bool isAnonymous, | ||
1230 | 1291 | store::Item_t qname, | 1383 | store::Item_t qname, |
1231 | 1292 | const xqtref_t& baseType, | 1384 | const xqtref_t& baseType, |
1232 | 1293 | TypeConstants::quantifier_t quantifier, | 1385 | TypeConstants::quantifier_t quantifier, |
1233 | @@ -1295,8 +1387,9 @@ | |||
1234 | 1295 | bool builtin) | 1387 | bool builtin) |
1235 | 1296 | : | 1388 | : |
1236 | 1297 | XQType(manager, USER_DEFINED_KIND, quantifier, builtin), | 1389 | XQType(manager, USER_DEFINED_KIND, quantifier, builtin), |
1237 | 1390 | theIsAnonymous(isAnonymous), | ||
1238 | 1298 | theQName(qname), | 1391 | theQName(qname), |
1240 | 1299 | m_baseType(baseType), | 1392 | theBaseType(baseType), |
1241 | 1300 | theUDTKind(UNION_UDT), | 1393 | theUDTKind(UNION_UDT), |
1242 | 1301 | m_contentKind(SIMPLE_CONTENT_KIND), | 1394 | m_contentKind(SIMPLE_CONTENT_KIND), |
1243 | 1302 | m_unionItemTypes(unionItemTypes) | 1395 | m_unionItemTypes(unionItemTypes) |
1244 | @@ -1317,7 +1410,7 @@ | |||
1245 | 1317 | { | 1410 | { |
1246 | 1318 | serialize_baseclass(ar, (XQType*)this); | 1411 | serialize_baseclass(ar, (XQType*)this); |
1247 | 1319 | ar & theQName; | 1412 | ar & theQName; |
1249 | 1320 | ar & m_baseType; | 1413 | ar & theBaseType; |
1250 | 1321 | SERIALIZE_ENUM(UDTKind, theUDTKind); | 1414 | SERIALIZE_ENUM(UDTKind, theUDTKind); |
1251 | 1322 | SERIALIZE_ENUM(content_kind_t, m_contentKind); | 1415 | SERIALIZE_ENUM(content_kind_t, m_contentKind); |
1252 | 1323 | ar & m_listItemType; | 1416 | ar & m_listItemType; |
1253 | @@ -1330,7 +1423,7 @@ | |||
1254 | 1330 | ********************************************************************************/ | 1423 | ********************************************************************************/ |
1255 | 1331 | xqtref_t UserDefinedXQType::getBaseBuiltinType() const | 1424 | xqtref_t UserDefinedXQType::getBaseBuiltinType() const |
1256 | 1332 | { | 1425 | { |
1258 | 1333 | xqtref_t builtinType = m_baseType; | 1426 | xqtref_t builtinType = theBaseType; |
1259 | 1334 | 1427 | ||
1260 | 1335 | while (builtinType->type_kind() == XQType::USER_DEFINED_KIND) | 1428 | while (builtinType->type_kind() == XQType::USER_DEFINED_KIND) |
1261 | 1336 | { | 1429 | { |
1262 | @@ -1501,7 +1594,7 @@ | |||
1263 | 1501 | << theQName->getNamespace() << " " | 1594 | << theQName->getNamespace() << " " |
1264 | 1502 | << info.str() | 1595 | << info.str() |
1265 | 1503 | << " base:" | 1596 | << " base:" |
1267 | 1504 | << ( m_baseType ? m_baseType->toString() : "NULL" ) | 1597 | << ( theBaseType ? theBaseType->toString() : "NULL" ) |
1268 | 1505 | << "]"; | 1598 | << "]"; |
1269 | 1506 | } | 1599 | } |
1270 | 1507 | 1600 | ||
1271 | 1508 | 1601 | ||
1272 | === modified file 'src/types/typeimpl.h' | |||
1273 | --- src/types/typeimpl.h 2013-03-08 15:03:58 +0000 | |||
1274 | +++ src/types/typeimpl.h 2013-04-30 21:00:38 +0000 | |||
1275 | @@ -375,6 +375,8 @@ | |||
1276 | 375 | 375 | ||
1277 | 376 | int card() const; | 376 | int card() const; |
1278 | 377 | 377 | ||
1279 | 378 | virtual bool isAnonymous() const { return false; } | ||
1280 | 379 | |||
1281 | 378 | bool isComplex() const; | 380 | bool isComplex() const; |
1282 | 379 | 381 | ||
1283 | 380 | bool isList() const; | 382 | bool isList() const; |
1284 | @@ -567,11 +569,11 @@ | |||
1285 | 567 | friend class XQType; | 569 | friend class XQType; |
1286 | 568 | 570 | ||
1287 | 569 | private: | 571 | private: |
1290 | 570 | store::StoreConsts::NodeKind m_node_kind; | 572 | store::StoreConsts::NodeKind theNodeKind; |
1291 | 571 | store::Item_t m_node_name; | 573 | store::Item_t theNodeName; |
1292 | 572 | xqtref_t theContentType; | 574 | xqtref_t theContentType; |
1295 | 573 | bool m_nillable; | 575 | bool theNillable; |
1296 | 574 | bool m_schema_test; | 576 | bool theIsSchemaTest; |
1297 | 575 | 577 | ||
1298 | 576 | public: | 578 | public: |
1299 | 577 | SERIALIZABLE_CLASS(NodeXQType) | 579 | SERIALIZABLE_CLASS(NodeXQType) |
1300 | @@ -589,19 +591,17 @@ | |||
1301 | 589 | bool schematest, | 591 | bool schematest, |
1302 | 590 | bool builtin = false); | 592 | bool builtin = false); |
1303 | 591 | 593 | ||
1313 | 592 | NodeXQType( | 594 | NodeXQType(const NodeXQType& source, TypeConstants::quantifier_t quant); |
1314 | 593 | const NodeXQType& source, | 595 | |
1315 | 594 | TypeConstants::quantifier_t quantifier); | 596 | store::StoreConsts::NodeKind get_node_kind() const { return theNodeKind; } |
1316 | 595 | 597 | ||
1317 | 596 | store::StoreConsts::NodeKind get_node_kind() const { return m_node_kind; } | 598 | store::Item* get_node_name() const { return theNodeName.getp(); } |
1318 | 597 | 599 | ||
1319 | 598 | store::Item* get_node_name() const { return m_node_name.getp(); } | 600 | bool is_schema_test() const { return theIsSchemaTest; } |
1311 | 599 | |||
1312 | 600 | bool is_schema_test() const { return m_schema_test; } | ||
1320 | 601 | 601 | ||
1321 | 602 | const XQType* get_content_type() const { return theContentType.getp(); } | 602 | const XQType* get_content_type() const { return theContentType.getp(); } |
1322 | 603 | 603 | ||
1324 | 604 | bool get_nillable() const { return m_nillable; } | 604 | bool get_nillable() const { return theNillable; } |
1325 | 605 | 605 | ||
1326 | 606 | bool is_untyped() const; | 606 | bool is_untyped() const; |
1327 | 607 | 607 | ||
1328 | @@ -718,7 +718,7 @@ | |||
1329 | 718 | ------------ | 718 | ------------ |
1330 | 719 | The baseType of this type. NULL for list or union types. | 719 | The baseType of this type. NULL for list or union types. |
1331 | 720 | 720 | ||
1333 | 721 | m_typeCategory: | 721 | theUDTKind: |
1334 | 722 | --------------- | 722 | --------------- |
1335 | 723 | Whether this is an atomic, list, union, or complex type. | 723 | Whether this is an atomic, list, union, or complex type. |
1336 | 724 | 724 | ||
1337 | @@ -743,9 +743,11 @@ | |||
1338 | 743 | 743 | ||
1339 | 744 | 744 | ||
1340 | 745 | private: | 745 | private: |
1341 | 746 | bool theIsAnonymous; | ||
1342 | 747 | |||
1343 | 746 | store::Item_t theQName; | 748 | store::Item_t theQName; |
1344 | 747 | 749 | ||
1346 | 748 | xqtref_t m_baseType; | 750 | xqtref_t theBaseType; |
1347 | 749 | 751 | ||
1348 | 750 | UDTKind theUDTKind; | 752 | UDTKind theUDTKind; |
1349 | 751 | 753 | ||
1350 | @@ -767,6 +769,7 @@ | |||
1351 | 767 | // constructor for Atomic and Complex types | 769 | // constructor for Atomic and Complex types |
1352 | 768 | UserDefinedXQType( | 770 | UserDefinedXQType( |
1353 | 769 | const TypeManager* manager, | 771 | const TypeManager* manager, |
1354 | 772 | bool isAnonymous, | ||
1355 | 770 | store::Item_t qname, | 773 | store::Item_t qname, |
1356 | 771 | const xqtref_t& baseType, | 774 | const xqtref_t& baseType, |
1357 | 772 | TypeConstants::quantifier_t quantifier, | 775 | TypeConstants::quantifier_t quantifier, |
1358 | @@ -777,6 +780,7 @@ | |||
1359 | 777 | // Constructor for List types | 780 | // Constructor for List types |
1360 | 778 | UserDefinedXQType( | 781 | UserDefinedXQType( |
1361 | 779 | const TypeManager* manager, | 782 | const TypeManager* manager, |
1362 | 783 | bool isAnonymous, | ||
1363 | 780 | store::Item_t qname, | 784 | store::Item_t qname, |
1364 | 781 | const xqtref_t& baseType, | 785 | const xqtref_t& baseType, |
1365 | 782 | const XQType* listItemType, | 786 | const XQType* listItemType, |
1366 | @@ -785,6 +789,7 @@ | |||
1367 | 785 | // Constructor for Union types | 789 | // Constructor for Union types |
1368 | 786 | UserDefinedXQType( | 790 | UserDefinedXQType( |
1369 | 787 | const TypeManager* manager, | 791 | const TypeManager* manager, |
1370 | 792 | bool isAnonymous, | ||
1371 | 788 | store::Item_t qname, | 793 | store::Item_t qname, |
1372 | 789 | const xqtref_t& baseType, | 794 | const xqtref_t& baseType, |
1373 | 790 | TypeConstants::quantifier_t quantifier, | 795 | TypeConstants::quantifier_t quantifier, |
1374 | @@ -793,11 +798,13 @@ | |||
1375 | 793 | 798 | ||
1376 | 794 | virtual ~UserDefinedXQType() {} | 799 | virtual ~UserDefinedXQType() {} |
1377 | 795 | 800 | ||
1378 | 801 | virtual bool isAnonymous() const { return theIsAnonymous; } | ||
1379 | 802 | |||
1380 | 796 | virtual content_kind_t content_kind() const { return m_contentKind; }; | 803 | virtual content_kind_t content_kind() const { return m_contentKind; }; |
1381 | 797 | 804 | ||
1382 | 798 | UDTKind getUDTKind() const { return theUDTKind; } | 805 | UDTKind getUDTKind() const { return theUDTKind; } |
1383 | 799 | 806 | ||
1385 | 800 | xqtref_t getBaseType() const { return m_baseType; } | 807 | xqtref_t getBaseType() const { return theBaseType; } |
1386 | 801 | 808 | ||
1387 | 802 | xqtref_t getBaseBuiltinType() const; | 809 | xqtref_t getBaseBuiltinType() const; |
1388 | 803 | 810 | ||
1389 | 804 | 811 | ||
1390 | === modified file 'src/types/typemanager.h' | |||
1391 | --- src/types/typemanager.h 2013-02-07 17:24:36 +0000 | |||
1392 | +++ src/types/typemanager.h 2013-04-30 21:00:38 +0000 | |||
1393 | @@ -159,17 +159,18 @@ | |||
1394 | 159 | TypeConstants::quantifier_t quant, | 159 | TypeConstants::quantifier_t quant, |
1395 | 160 | const QueryLoc& loc) const = 0; | 160 | const QueryLoc& loc) const = 0; |
1396 | 161 | 161 | ||
1398 | 162 | virtual void get_schema_element_typename( | 162 | virtual void get_schema_element_typeinfo( |
1399 | 163 | const store::Item* elemName, | 163 | const store::Item* elemName, |
1400 | 164 | store::Item_t& typeName, | 164 | store::Item_t& typeName, |
1402 | 165 | const QueryLoc& loc) = 0; | 165 | bool& nillable, |
1403 | 166 | const QueryLoc& loc) const = 0; | ||
1404 | 166 | 167 | ||
1405 | 167 | virtual xqtref_t create_schema_attribute_type( | 168 | virtual xqtref_t create_schema_attribute_type( |
1406 | 168 | const store::Item_t& aName, | 169 | const store::Item_t& aName, |
1407 | 169 | TypeConstants::quantifier_t quant, | 170 | TypeConstants::quantifier_t quant, |
1408 | 170 | const QueryLoc& loc) const = 0; | 171 | const QueryLoc& loc) const = 0; |
1409 | 171 | 172 | ||
1411 | 172 | virtual void get_schema_attribute_typename( | 173 | virtual void get_schema_attribute_typeinfo( |
1412 | 173 | const store::Item* attrName, | 174 | const store::Item* attrName, |
1413 | 174 | store::Item_t& typeName, | 175 | store::Item_t& typeName, |
1414 | 175 | const QueryLoc& loc) = 0; | 176 | const QueryLoc& loc) = 0; |
1415 | 176 | 177 | ||
1416 | === modified file 'src/types/typemanagerimpl.cpp' | |||
1417 | --- src/types/typemanagerimpl.cpp 2013-04-16 07:39:27 +0000 | |||
1418 | +++ src/types/typemanagerimpl.cpp 2013-04-30 21:00:38 +0000 | |||
1419 | @@ -893,14 +893,16 @@ | |||
1420 | 893 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); | 893 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); |
1421 | 894 | } | 894 | } |
1422 | 895 | 895 | ||
1423 | 896 | bool nillable; | ||
1424 | 897 | |||
1425 | 896 | xqtref_t contentType = | 898 | xqtref_t contentType = |
1427 | 897 | m_schema->createXQTypeFromElementName(this, elemName, true, loc); | 899 | m_schema->createXQTypeFromGlobalElementDecl(this, elemName, true, nillable, loc); |
1428 | 898 | 900 | ||
1429 | 899 | return create_node_type(store::StoreConsts::elementNode, | 901 | return create_node_type(store::StoreConsts::elementNode, |
1430 | 900 | elemName, | 902 | elemName, |
1431 | 901 | contentType, | 903 | contentType, |
1432 | 902 | quant, | 904 | quant, |
1434 | 903 | false, // nillable | 905 | nillable, |
1435 | 904 | true); // schematest | 906 | true); // schematest |
1436 | 905 | } | 907 | } |
1437 | 906 | 908 | ||
1438 | @@ -908,10 +910,11 @@ | |||
1439 | 908 | /***************************************************************************//** | 910 | /***************************************************************************//** |
1440 | 909 | Get the name of the type associated with a given globally declared element name. | 911 | Get the name of the type associated with a given globally declared element name. |
1441 | 910 | ********************************************************************************/ | 912 | ********************************************************************************/ |
1443 | 911 | void TypeManagerImpl::get_schema_element_typename( | 913 | void TypeManagerImpl::get_schema_element_typeinfo( |
1444 | 912 | const store::Item* elemName, | 914 | const store::Item* elemName, |
1445 | 913 | store::Item_t& typeName, | 915 | store::Item_t& typeName, |
1447 | 914 | const QueryLoc& loc) | 916 | bool& nillable, |
1448 | 917 | const QueryLoc& loc) const | ||
1449 | 915 | { | 918 | { |
1450 | 916 | if (m_schema == NULL) | 919 | if (m_schema == NULL) |
1451 | 917 | { | 920 | { |
1452 | @@ -919,7 +922,7 @@ | |||
1453 | 919 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); | 922 | ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); |
1454 | 920 | } | 923 | } |
1455 | 921 | 924 | ||
1457 | 922 | m_schema->getTypeNameFromElementName(elemName, typeName, loc); | 925 | m_schema->getInfoFromGlobalElementDecl(elemName, typeName, nillable, loc); |
1458 | 923 | } | 926 | } |
1459 | 924 | 927 | ||
1460 | 925 | 928 | ||
1461 | @@ -941,7 +944,7 @@ | |||
1462 | 941 | } | 944 | } |
1463 | 942 | 945 | ||
1464 | 943 | xqtref_t contentType = | 946 | xqtref_t contentType = |
1466 | 944 | m_schema->createXQTypeFromAttributeName(this, attrName, true, loc); | 947 | m_schema->createXQTypeFromGlobalAttributeDecl(this, attrName, true, loc); |
1467 | 945 | 948 | ||
1468 | 946 | return create_node_type(store::StoreConsts::attributeNode, | 949 | return create_node_type(store::StoreConsts::attributeNode, |
1469 | 947 | attrName, | 950 | attrName, |
1470 | @@ -956,7 +959,7 @@ | |||
1471 | 956 | Get the name of the type associated with a given globally declared attribute | 959 | Get the name of the type associated with a given globally declared attribute |
1472 | 957 | name. | 960 | name. |
1473 | 958 | ********************************************************************************/ | 961 | ********************************************************************************/ |
1475 | 959 | void TypeManagerImpl::get_schema_attribute_typename( | 962 | void TypeManagerImpl::get_schema_attribute_typeinfo( |
1476 | 960 | const store::Item* attrName, | 963 | const store::Item* attrName, |
1477 | 961 | store::Item_t& typeName, | 964 | store::Item_t& typeName, |
1478 | 962 | const QueryLoc& loc) | 965 | const QueryLoc& loc) |
1479 | @@ -967,7 +970,7 @@ | |||
1480 | 967 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); | 970 | ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); |
1481 | 968 | } | 971 | } |
1482 | 969 | 972 | ||
1484 | 970 | m_schema->getTypeNameFromAttributeName(attrName, typeName, loc); | 973 | m_schema->getInfoFromGlobalAttributeDecl(attrName, typeName, loc); |
1485 | 971 | } | 974 | } |
1486 | 972 | 975 | ||
1487 | 973 | 976 | ||
1488 | @@ -1062,6 +1065,7 @@ | |||
1489 | 1062 | if (udt.isList()) | 1065 | if (udt.isList()) |
1490 | 1063 | { | 1066 | { |
1491 | 1064 | return new UserDefinedXQType(this, | 1067 | return new UserDefinedXQType(this, |
1492 | 1068 | udt.isAnonymous(), | ||
1493 | 1065 | udt.getQName(), | 1069 | udt.getQName(), |
1494 | 1066 | udt.getBaseType(), | 1070 | udt.getBaseType(), |
1495 | 1067 | udt.getListItemType()); | 1071 | udt.getListItemType()); |
1496 | @@ -1069,6 +1073,7 @@ | |||
1497 | 1069 | else if (udt.isUnion()) | 1073 | else if (udt.isUnion()) |
1498 | 1070 | { | 1074 | { |
1499 | 1071 | return new UserDefinedXQType(this, | 1075 | return new UserDefinedXQType(this, |
1500 | 1076 | udt.isAnonymous(), | ||
1501 | 1072 | udt.getQName(), | 1077 | udt.getQName(), |
1502 | 1073 | udt.getBaseType(), | 1078 | udt.getBaseType(), |
1503 | 1074 | quantifier, | 1079 | quantifier, |
1504 | @@ -1077,6 +1082,7 @@ | |||
1505 | 1077 | else | 1082 | else |
1506 | 1078 | { | 1083 | { |
1507 | 1079 | return new UserDefinedXQType(this, | 1084 | return new UserDefinedXQType(this, |
1508 | 1085 | udt.isAnonymous(), | ||
1509 | 1080 | udt.getQName(), | 1086 | udt.getQName(), |
1510 | 1081 | udt.getBaseType(), | 1087 | udt.getBaseType(), |
1511 | 1082 | quantifier, | 1088 | quantifier, |
1512 | 1083 | 1089 | ||
1513 | === modified file 'src/types/typemanagerimpl.h' | |||
1514 | --- src/types/typemanagerimpl.h 2013-02-07 17:24:36 +0000 | |||
1515 | +++ src/types/typemanagerimpl.h 2013-04-30 21:00:38 +0000 | |||
1516 | @@ -148,17 +148,18 @@ | |||
1517 | 148 | TypeConstants::quantifier_t quant, | 148 | TypeConstants::quantifier_t quant, |
1518 | 149 | const QueryLoc& loc) const; | 149 | const QueryLoc& loc) const; |
1519 | 150 | 150 | ||
1521 | 151 | void get_schema_element_typename( | 151 | void get_schema_element_typeinfo( |
1522 | 152 | const store::Item* elemName, | 152 | const store::Item* elemName, |
1523 | 153 | store::Item_t& typeName, | 153 | store::Item_t& typeName, |
1525 | 154 | const QueryLoc& loc); | 154 | bool& nillable, |
1526 | 155 | const QueryLoc& loc) const; | ||
1527 | 155 | 156 | ||
1528 | 156 | xqtref_t create_schema_attribute_type( | 157 | xqtref_t create_schema_attribute_type( |
1529 | 157 | const store::Item_t& attrName, | 158 | const store::Item_t& attrName, |
1530 | 158 | TypeConstants::quantifier_t quant, | 159 | TypeConstants::quantifier_t quant, |
1531 | 159 | const QueryLoc& loc) const; | 160 | const QueryLoc& loc) const; |
1532 | 160 | 161 | ||
1534 | 161 | void get_schema_attribute_typename( | 162 | void get_schema_attribute_typeinfo( |
1535 | 162 | const store::Item* attrName, | 163 | const store::Item* attrName, |
1536 | 163 | store::Item_t& typeName, | 164 | store::Item_t& typeName, |
1537 | 164 | const QueryLoc& loc); | 165 | const QueryLoc& loc); |
1538 | 165 | 166 | ||
1539 | === modified file 'src/types/typeops.cpp' | |||
1540 | --- src/types/typeops.cpp 2013-03-16 08:48:16 +0000 | |||
1541 | +++ src/types/typeops.cpp 2013-04-30 21:00:38 +0000 | |||
1542 | @@ -131,20 +131,32 @@ | |||
1543 | 131 | return false; | 131 | return false; |
1544 | 132 | 132 | ||
1545 | 133 | #ifndef ZORBA_NO_XMLSCHEMA | 133 | #ifndef ZORBA_NO_XMLSCHEMA |
1560 | 134 | if (ntype.get_node_kind() == store::StoreConsts::elementNode) | 134 | try |
1561 | 135 | { | 135 | { |
1562 | 136 | return (schema->createXQTypeFromElementName(tm, | 136 | bool nillable; |
1563 | 137 | ntype.get_node_name(), | 137 | store::Item_t typeName; |
1564 | 138 | false, | 138 | if (ntype.get_node_kind() == store::StoreConsts::elementNode) |
1565 | 139 | QueryLoc::null) != NULL); | 139 | { |
1566 | 140 | } | 140 | schema->getInfoFromGlobalElementDecl(ntype.get_node_name(), |
1567 | 141 | else | 141 | typeName, |
1568 | 142 | { | 142 | nillable, |
1569 | 143 | return (schema->createXQTypeFromAttributeName(tm, | 143 | QueryLoc::null); |
1570 | 144 | ntype.get_node_name(), | 144 | } |
1571 | 145 | false, | 145 | else |
1572 | 146 | QueryLoc::null) != NULL); | 146 | { |
1573 | 147 | } | 147 | schema->getInfoFromGlobalAttributeDecl(ntype.get_node_name(), |
1574 | 148 | typeName, | ||
1575 | 149 | QueryLoc::null); | ||
1576 | 150 | } | ||
1577 | 151 | } | ||
1578 | 152 | catch (ZorbaException& e) | ||
1579 | 153 | { | ||
1580 | 154 | if (e.diagnostic() == err::XPST0008) | ||
1581 | 155 | return false; | ||
1582 | 156 | |||
1583 | 157 | throw; | ||
1584 | 158 | } | ||
1585 | 159 | |||
1586 | 148 | #else | 160 | #else |
1587 | 149 | throw ZORBA_EXCEPTION(err::XQST0009); | 161 | throw ZORBA_EXCEPTION(err::XQST0009); |
1588 | 150 | #endif | 162 | #endif |
1589 | 151 | 163 | ||
1590 | === modified file 'test/fots/CMakeLists.txt' | |||
1591 | --- test/fots/CMakeLists.txt 2013-04-30 18:31:49 +0000 | |||
1592 | +++ test/fots/CMakeLists.txt 2013-04-30 21:00:38 +0000 | |||
1593 | @@ -134,6 +134,22 @@ | |||
1594 | 134 | EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy20 21619) | 134 | EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy20 21619) |
1595 | 135 | EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy21 21619) | 135 | EXPECTED_FOTS_FAILURE (DISPUTED prod-OrderByClause orderBy21 21619) |
1596 | 136 | EXPECTED_FOTS_FAILURE (DISPUTED misc-CombinedErrorCodes XQST0085 21730) | 136 | EXPECTED_FOTS_FAILURE (DISPUTED misc-CombinedErrorCodes XQST0085 21730) |
1597 | 137 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-001 21568) | ||
1598 | 138 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-003 21568) | ||
1599 | 139 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-005 21568) | ||
1600 | 140 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-007 21568) | ||
1601 | 141 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-009 21568) | ||
1602 | 142 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-012 21568) | ||
1603 | 143 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-013 21568) | ||
1604 | 144 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-015 21568) | ||
1605 | 145 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-017 21568) | ||
1606 | 146 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-019 21568) | ||
1607 | 147 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-021 21568) | ||
1608 | 148 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-023 21568) | ||
1609 | 149 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-025 21568) | ||
1610 | 150 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-027 21568) | ||
1611 | 151 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-029 21568) | ||
1612 | 152 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-031 21568) | ||
1613 | 137 | EXPECTED_FOTS_FAILURE (DISPUTED prod-VarDefaultValue extvardef-006b 21832) | 153 | EXPECTED_FOTS_FAILURE (DISPUTED prod-VarDefaultValue extvardef-006b 21832) |
1614 | 138 | 154 | ||
1615 | 139 | # Next three possibly unique to old RQ machine, but they need to be | 155 | # Next three possibly unique to old RQ machine, but they need to be |
1616 | @@ -186,21 +202,6 @@ | |||
1617 | 186 | EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0) | 202 | EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0) |
1618 | 187 | EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0) | 203 | EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0) |
1619 | 188 | EXPECTED_FOTS_FAILURE (fn-matches cbcl-matches-038 1131304) | 204 | EXPECTED_FOTS_FAILURE (fn-matches cbcl-matches-038 1131304) |
1620 | 189 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-33 0) | ||
1621 | 190 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-35 0) | ||
1622 | 191 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-37 0) | ||
1623 | 192 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-38 0) | ||
1624 | 193 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-39 0) | ||
1625 | 194 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-41 0) | ||
1626 | 195 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-44 0) | ||
1627 | 196 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-45 0) | ||
1628 | 197 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-46 0) | ||
1629 | 198 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-47 0) | ||
1630 | 199 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-50 0) | ||
1631 | 200 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-51 0) | ||
1632 | 201 | EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-52 0) | ||
1633 | 202 | EXPECTED_FOTS_FAILURE (fn-nilled cbcl-nilled-002 0) | ||
1634 | 203 | EXPECTED_FOTS_FAILURE (fn-nilled cbcl-nilled-005 0) | ||
1635 | 204 | EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-23 0) | 205 | EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-23 0) |
1636 | 205 | EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-25 0) | 206 | EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-25 0) |
1637 | 206 | EXPECTED_FOTS_FAILURE (fn-normalize-unicode cbcl-fn-normalize-unicode-001 0) | 207 | EXPECTED_FOTS_FAILURE (fn-normalize-unicode cbcl-fn-normalize-unicode-001 0) |
1638 | @@ -309,22 +310,6 @@ | |||
1639 | 309 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-014 0) | 310 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-014 0) |
1640 | 310 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-015 0) | 311 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-015 0) |
1641 | 311 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-016 0) | 312 | EXPECTED_FOTS_FAILURE (prod-FunctionCall function-call-reserved-function-names-016 0) |
1642 | 312 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-001 21568) | ||
1643 | 313 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-003 21568) | ||
1644 | 314 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-005 21568) | ||
1645 | 315 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-007 21568) | ||
1646 | 316 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-009 21568) | ||
1647 | 317 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-012 21568) | ||
1648 | 318 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-013 21568) | ||
1649 | 319 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-015 21568) | ||
1650 | 320 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-017 21568) | ||
1651 | 321 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-019 21568) | ||
1652 | 322 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-021 21568) | ||
1653 | 323 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-023 21568) | ||
1654 | 324 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-025 21568) | ||
1655 | 325 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-027 21568) | ||
1656 | 326 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-029 21568) | ||
1657 | 327 | EXPECTED_FOTS_FAILURE (DISPUTED prod-FunctionDecl function-decl-reserved-function-names-031 21568) | ||
1658 | 328 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof113 0) | 313 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof113 0) |
1659 | 329 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof139 1160559) | 314 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof139 1160559) |
1660 | 330 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof140 0) | 315 | EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof140 0) |
1661 | 331 | 316 | ||
1662 | === modified file 'test/rbkt/Queries/zorba/schemas/books.xsd' | |||
1663 | --- test/rbkt/Queries/zorba/schemas/books.xsd 2013-02-07 17:24:36 +0000 | |||
1664 | +++ test/rbkt/Queries/zorba/schemas/books.xsd 2013-04-30 21:00:38 +0000 | |||
1665 | @@ -5,8 +5,8 @@ | |||
1666 | 5 | elementFormDefault="qualified"> | 5 | elementFormDefault="qualified"> |
1667 | 6 | 6 | ||
1668 | 7 | <!-- importing the XML namespace makes xml:id an ID attribute under lax validation --> | 7 | <!-- importing the XML namespace makes xml:id an ID attribute under lax validation --> |
1671 | 8 | <xs:import namespace="http://www.w3.org/XML/1998/namespace"/> | 8 | <xs:import namespace="http://www.w3.org/XML/1998/namespace" |
1672 | 9 | 9 | schemaLocation="http://www.w3.org/2001/xml.xsd"/> | |
1673 | 10 | 10 | ||
1674 | 11 | <xs:element name="BOOKLIST"> | 11 | <xs:element name="BOOKLIST"> |
1675 | 12 | <xs:complexType> | 12 | <xs:complexType> |
1676 | 13 | 13 | ||
1677 | === modified file 'test/update/Scripts/Readme.txt' | |||
1678 | --- test/update/Scripts/Readme.txt 2013-02-07 17:24:36 +0000 | |||
1679 | +++ test/update/Scripts/Readme.txt 2013-04-30 21:00:38 +0000 | |||
1680 | @@ -14,12 +14,13 @@ | |||
1681 | 14 | # | 14 | # |
1682 | 15 | To generate a report for submitting to the W3C: | 15 | To generate a report for submitting to the W3C: |
1683 | 16 | 16 | ||
1685 | 17 | 0. For submitting reports to W3C one should compile Zorba with: | 17 | 0. For submitting reports to W3C one should compile Zorba with |
1686 | 18 | ZORBA_WITH_BIG_INTEGER=ON | 18 | ZORBA_WITH_BIG_INTEGER=ON |
1687 | 19 | ZORBA_XQUERYX=ON | 19 | ZORBA_XQUERYX=ON |
1688 | 20 | ZORBA_TEST_XQUERYX=ON | 20 | ZORBA_TEST_XQUERYX=ON |
1689 | 21 | ZORBA_TEST_W3C_TO_SUBMIT_RESULTS=ON | 21 | ZORBA_TEST_W3C_TO_SUBMIT_RESULTS=ON |
1690 | 22 | ZORBA_WITH_JSON=OFF | 22 | ZORBA_WITH_JSON=OFF |
1691 | 23 | And make sure you are using at least Xerces version 3.1.1. | ||
1692 | 23 | 24 | ||
1693 | 24 | 1. Import XQUTS. | 25 | 1. Import XQUTS. |
1694 | 25 | 26 | ||
1695 | @@ -62,5 +63,3 @@ | |||
1696 | 62 | 7. Modify /tmp/XQUTS_1_0_1/ReportingResults/Results.xml by adding a result node for every report you copied at step 5. | 63 | 7. Modify /tmp/XQUTS_1_0_1/ReportingResults/Results.xml by adding a result node for every report you copied at step 5. |
1697 | 63 | 64 | ||
1698 | 64 | 8. From /tmp/XQUTS_1_0_1/ReportingResults/ run 'ant -buildfile Build.xml' in order to generate XQUTSReport.html and XQUTSReportSimple.html | 65 | 8. From /tmp/XQUTS_1_0_1/ReportingResults/ run 'ant -buildfile Build.xml' in order to generate XQUTSReport.html and XQUTSReportSimple.html |
1699 | 65 | |||
1700 | 66 | |||
1701 | 67 | 66 | ||
1702 | === modified file 'test/update/updtestdriver.cpp' | |||
1703 | --- test/update/updtestdriver.cpp 2013-03-14 08:01:06 +0000 | |||
1704 | +++ test/update/updtestdriver.cpp 2013-04-30 21:00:38 +0000 | |||
1705 | @@ -44,6 +44,9 @@ | |||
1706 | 44 | #include "system/properties.h" | 44 | #include "system/properties.h" |
1707 | 45 | #include "testdriver_comparator.h" | 45 | #include "testdriver_comparator.h" |
1708 | 46 | 46 | ||
1709 | 47 | //#define ZORBA_TEST_PLAN_SERIALIZATION | ||
1710 | 48 | |||
1711 | 49 | |||
1712 | 47 | bool isErrorExpected(zorba::ZorbaException& e, State* aState) | 50 | bool isErrorExpected(zorba::ZorbaException& e, State* aState) |
1713 | 48 | { | 51 | { |
1714 | 49 | if ( aState->hasErrors) | 52 | if ( aState->hasErrors) |
Validation queue starting for merge proposal. zorbatest. lambda. nu:8080/ remotequeue/ bug1147563- 2013-04- 25T09-55- 48.874Z/ log.html
Log at: http://