Merge lp:~zorba-coders/zorba/bugs-912586-912593-912722 into lp:zorba

Proposed by Federico Cavalieri
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/bugs-912586-912593-912722
Merge into: lp:zorba
Diff against target: 159 lines (+74/-2)
13 files modified
ChangeLog (+1/-0)
src/types/schema/SchemaValidatorFilter.cpp (+8/-2)
test/rbkt/Queries/zorba/schemas/extracontent.xsd (+9/-0)
test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq (+9/-0)
test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq (+10/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq (+11/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq (+11/-0)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bugs-912586-912593-912722
Reviewer Review Type Date Requested Status
Cezar Andrei Approve
Markos Zaharioudakis Approve
Review via email: mp+87749@code.launchpad.net

This proposal has been superseded by a proposal from 2012-03-28.

Commit message

Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)

Description of the change

Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)

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

Validation queue job bugs2-2012-01-06T13-33-00.575Z is finished. The final status was:

All tests succeeded!

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

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

Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

Federico, I am approving this, but my knowledge of XML Schema and Zorba's implementation of it is not good enough to do a real review. So, I am also adding Cezar as a reviewer.

For example, after your fix, the query in bug #912722 complains that "no declaration found for element 'a'". But, I think, the real problem is that <a> should not be there at all given that the type of the "root" element is xs:int. But then again, I could be wrong. That's why I am sking Cezar to review this,

Revision history for this message
Markos Zaharioudakis (markos-za) :
review: Approve
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

Markos is correct, if <a/> element is inside <root> element than, root has a complex type and is not a simple type which anysimpleType represents. This should make the validation failing in the example from bug #912722 even if lax is specified. So this doesn't fix the bug #912722, at least the comment "Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)" should be changed.

review: Needs Fixing
Revision history for this message
Markos Zaharioudakis (markos-za) wrote :

> Markos is correct, if <a/> element is inside <root> element than, root has a
> complex type and is not a simple type which anysimpleType represents. This
> should make the validation failing in the example from bug #912722 even if lax
> is specified. So this doesn't fix the bug #912722, at least the comment "Fixed
> bug #912586, #912593 and #912722 (assertion failures with lax validation)"
> should be changed.

Cezar, will you then take care of these bugs and provide the correct fixes? Federico is only a volunteer at this time, and he shouldn't be spending too much time on this.

Federico, will you transfer these bugs to Cezar? What is their priority? Are they blocking the PUL-related work?

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

I transferred the bugs to Cezar, thanks.

They are blocking the merge of the PUL production/application. When those are fixed I think there will be another very small issue to cope with validation, which occur when I try to validate an element against a specific type definition. However, maybe a real fix to 912722 will solve this.

All in all i do not consider them really urgent, because I am about to leave for a conference, and I will be basically unavailable to do real work for a week or so. Thus even if they are fixed in this timeframe the integration of the PUL branch will not occur sooner. Is a real fix to 912722 expensive to make?

Cheers

Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

I'm not sure, if I figure the right Xerces Error code for it should be easy
but prom past this was quite tricky.

Cezar

On Tue, Jan 24, 2012 at 8:04 AM, Federico Cavalieri
<email address hidden>wrote:

> I transferred the bugs to Cezar, thanks.
>
> They are blocking the merge of the PUL production/application. When those
> are fixed I think there will be another very small issue to cope with
> validation, which occur when I try to validate an element against a
> specific type definition. However, maybe a real fix to 912722 will solve
> this.
>
> All in all i do not consider them really urgent, because I am about to
> leave for a conference, and I will be basically unavailable to do real work
> for a week or so. Thus even if they are fixed in this timeframe the
> integration of the PUL branch will not occur sooner. Is a real fix to
> 912722 expensive to make?
>
> Cheers
> --
>
> https://code.launchpad.net/~zorba-coders/zorba/bugs-912586-912593-912722/+merge/87749<https://code.launchpad.net/%7Ezorba-coders/zorba/bugs-912586-912593-912722/+merge/87749>
> Your team Zorba Coders is subscribed to branch lp:zorba.
>
> --
> Mailing list: https://launchpad.net/~zorba-coders
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~zorba-coders
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

After a closer look the bugs are fixed and all the new testcase check for specific errors. Indeed the message can be misleading in the case of bug #912722 but not totaly incorect (depending on the implented algorithm) and the error code is correct.

review: Approve
10611. By Cezar Andrei <email address hidden>

Merge from trunck and resolve ChangeLog conflict.

10612. By Cezar Andrei <email address hidden>

Fix ChangeLog conflicts.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2012-01-05 13:20:30 +0000
3+++ ChangeLog 2012-01-06 13:45:29 +0000
4@@ -19,6 +19,7 @@
5 * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression
6 support.
7 * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
8+ * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
9
10 version 2.1
11
12
13=== modified file 'src/types/schema/SchemaValidatorFilter.cpp'
14--- src/types/schema/SchemaValidatorFilter.cpp 2011-06-14 17:26:33 +0000
15+++ src/types/schema/SchemaValidatorFilter.cpp 2012-01-06 13:45:29 +0000
16@@ -1543,13 +1543,19 @@
17 if(!theStrictValidation &&
18 errDomain == XMLUni::fgValidityDomain &&
19 errType != XMLErrorReporter::ErrType_Fatal &&
20- !( errCode == XMLValid::ElementNotValidForContent ||
21+ !( errCode == XMLValid::AttNotDefined ||
22+ errCode == XMLValid::AttNotDefinedForElement ||
23+ errCode == XMLValid::SimpleTypeHasChild ||
24+ errCode == XMLValid::ElementNotValidForContent ||
25 errCode == XMLValid::NotEnoughElemsForCM ||
26 errCode == XMLValid::EmptyNotValidForContent ||
27 errCode == XMLValid::AttNotDefinedForElement ||
28 errCode == XMLValid::RequiredAttrNotProvided ||
29 errCode == XMLValid::AttributeNotQualified ||
30- errCode == XMLValid::ElementNotQualified) )
31+ errCode == XMLValid::ElementNotQualified) &&
32+ !(theParentStack &&
33+ errCode == XMLValid::ElementNotDefined)
34+ )
35 return;
36
37 theErrorOccurred = true;
38
39=== added file 'test/rbkt/Queries/zorba/schemas/extracontent.xsd'
40--- test/rbkt/Queries/zorba/schemas/extracontent.xsd 1970-01-01 00:00:00 +0000
41+++ test/rbkt/Queries/zorba/schemas/extracontent.xsd 2012-01-06 13:45:29 +0000
42@@ -0,0 +1,9 @@
43+<?xml version="1.0" encoding="UTF-8"?>
44+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
45+ targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
46+ elementFormDefault="qualified">
47+
48+ <xs:element name="root" type="xs:anySimpleType"/>
49+
50+
51+</xs:schema>
52
53=== added file 'test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec'
54--- test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec 1970-01-01 00:00:00 +0000
55+++ test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec 2012-01-06 13:45:29 +0000
56@@ -0,0 +1,1 @@
57+Error: http://www.w3.org/2005/xqt-errors:XQDY0027
58
59=== added file 'test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq'
60--- test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq 1970-01-01 00:00:00 +0000
61+++ test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq 2012-01-06 13:45:29 +0000
62@@ -0,0 +1,9 @@
63+import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
64+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
65+
66+declare revalidation lax;
67+
68+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
69+ xmlns="http://www.zorba-xquery.org/schema" aa="aa">
70+</root>};
71+$x/@*
72
73=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec'
74--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec 1970-01-01 00:00:00 +0000
75+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec 2012-01-06 13:45:29 +0000
76@@ -0,0 +1,1 @@
77+Error: http://www.w3.org/2005/xqt-errors:XQDY0027
78
79=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq'
80--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq 1970-01-01 00:00:00 +0000
81+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq 2012-01-06 13:45:29 +0000
82@@ -0,0 +1,10 @@
83+import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
84+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
85+
86+declare revalidation lax;
87+
88+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
89+ xmlns="http://www.zorba-xquery.org/schema">
90+<a/>aa
91+</root>};
92+$x/text()
93
94=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec'
95--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec 1970-01-01 00:00:00 +0000
96+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec 2012-01-06 13:45:29 +0000
97@@ -0,0 +1,1 @@
98+Error: http://www.w3.org/2005/xqt-errors:XQDY0027
99
100=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq'
101--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq 1970-01-01 00:00:00 +0000
102+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq 2012-01-06 13:45:29 +0000
103@@ -0,0 +1,10 @@
104+import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
105+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
106+
107+declare revalidation lax;
108+
109+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
110+ xmlns="http://www.zorba-xquery.org/schema">
111+<a/>
112+</root>};
113+$x/text()
114
115=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec'
116--- test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec 1970-01-01 00:00:00 +0000
117+++ test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec 2012-01-06 13:45:29 +0000
118@@ -0,0 +1,1 @@
119+Error: http://www.w3.org/2005/xqt-errors:XQDY0027
120
121=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq'
122--- test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq 1970-01-01 00:00:00 +0000
123+++ test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq 2012-01-06 13:45:29 +0000
124@@ -0,0 +1,11 @@
125+import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
126+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
127+
128+declare revalidation lax;
129+
130+declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
131+ xmlns="http://www.zorba-xquery.org/schema">
132+<a/>
133+</root>;
134+
135+schema:validate-in-place($doc);
136\ No newline at end of file
137
138=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec'
139--- test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec 1970-01-01 00:00:00 +0000
140+++ test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec 2012-01-06 13:45:29 +0000
141@@ -0,0 +1,1 @@
142+Error: http://www.w3.org/2005/xqt-errors:XQDY0027
143
144=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq'
145--- test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq 1970-01-01 00:00:00 +0000
146+++ test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq 2012-01-06 13:45:29 +0000
147@@ -0,0 +1,11 @@
148+import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
149+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
150+
151+declare revalidation lax;
152+
153+declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
154+ xmlns="http://www.zorba-xquery.org/schema" xx="xx">
155+
156+</root>;
157+
158+schema:validate-in-place($doc);
159\ No newline at end of file

Subscribers

People subscribed via source and target branches