Merge lp:~zorba-coders/zorba/ns-nodes into lp:zorba

Proposed by Markos Zaharioudakis
Status: Merged
Approved by: Markos Zaharioudakis
Approved revision: 11284
Merged at revision: 11536
Proposed branch: lp:~zorba-coders/zorba/ns-nodes
Merge into: lp:zorba
Diff against target: 72 lines (+24/-2)
3 files modified
src/runtime/core/constructors.cpp (+19/-1)
src/store/naive/node_items.cpp (+5/-0)
test/fots/CMakeLists.txt (+0/-1)
To merge this branch: bzr merge lp:~zorba-coders/zorba/ns-nodes
Reviewer Review Type Date Requested Status
Markos Zaharioudakis Approve
Review via email: mp+170942@code.launchpad.net

Commit message

Description of the change

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

Validation queue job ns-nodes-2013-06-22T11-07-02.352Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/core/constructors.cpp'
2--- src/runtime/core/constructors.cpp 2013-06-20 09:52:25 +0000
3+++ src/runtime/core/constructors.cpp 2013-06-22 11:03:28 +0000
4@@ -316,6 +316,7 @@
5 zstring baseuri;
6 zstring pre;
7 zstring ns;
8+ const store::NsBindings& localBindings = theLocalBindings->getLocalBindings();
9
10 ElementIteratorState* state;
11 DEFAULT_STACK_INIT(ElementIteratorState, state, planState);
12@@ -385,7 +386,7 @@
13 typeName,
14 true,
15 false,
16- theLocalBindings->getLocalBindings(),
17+ localBindings,
18 state->baseUri,
19 false);
20 }
21@@ -443,6 +444,23 @@
22 break;
23 }
24
25+ if (childKind == store::StoreConsts::namespaceNode)
26+ {
27+ csize numLocalBindings = localBindings.size();
28+
29+ for (csize i = 0; i < numLocalBindings; ++i)
30+ {
31+ const zstring& pre = localBindings[i].first;
32+ const zstring& ns = localBindings[i].second;
33+
34+ if (pre == child->getNamespacePrefix() && ns != child->getNamespaceUri())
35+ {
36+ RAISE_ERROR(err::XQDY0102, loc,
37+ ERROR_PARAMS(child->getNamespaceUri(), pre, ns));
38+ }
39+ }
40+ }
41+
42 if (child->getParent() != result.getp())
43 child->copy(result, copymode);
44 }
45
46=== modified file 'src/store/naive/node_items.cpp'
47--- src/store/naive/node_items.cpp 2013-06-11 23:38:49 +0000
48+++ src/store/naive/node_items.cpp 2013-06-22 11:03:28 +0000
49@@ -3412,6 +3412,11 @@
50 {
51 if (!ns.empty())
52 {
53+ if (prefix.empty() && theName->getNamespace().empty())
54+ {
55+ throw XQUERY_EXCEPTION(err::XQDY0102, ERROR_PARAMS(ns2, prefix, ns));
56+ }
57+
58 addLocalBinding(prefix, ns);
59 return;
60 }
61
62=== modified file 'test/fots/CMakeLists.txt'
63--- test/fots/CMakeLists.txt 2013-06-20 12:00:37 +0000
64+++ test/fots/CMakeLists.txt 2013-06-22 11:03:28 +0000
65@@ -230,7 +230,6 @@
66 EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-27 1110217)
67 EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-31 1110217)
68 EXPECTED_FOTS_FAILURE (prod-CompDocConstructor K2-ConDocNode-2 1188302)
69-EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-042 1188285)
70 EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-charref-2 1130998)
71 EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-007 1114221)
72 EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-008 1114221)

Subscribers

People subscribed via source and target branches