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
=== modified file 'ChangeLog'
--- ChangeLog 2012-01-05 13:20:30 +0000
+++ ChangeLog 2012-01-06 13:45:29 +0000
@@ -19,6 +19,7 @@
19 * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression19 * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression
20 support.20 support.
21 * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors21 * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
22 * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
2223
23version 2.124version 2.1
2425
2526
=== modified file 'src/types/schema/SchemaValidatorFilter.cpp'
--- src/types/schema/SchemaValidatorFilter.cpp 2011-06-14 17:26:33 +0000
+++ src/types/schema/SchemaValidatorFilter.cpp 2012-01-06 13:45:29 +0000
@@ -1543,13 +1543,19 @@
1543 if(!theStrictValidation &&1543 if(!theStrictValidation &&
1544 errDomain == XMLUni::fgValidityDomain &&1544 errDomain == XMLUni::fgValidityDomain &&
1545 errType != XMLErrorReporter::ErrType_Fatal &&1545 errType != XMLErrorReporter::ErrType_Fatal &&
1546 !( errCode == XMLValid::ElementNotValidForContent ||1546 !( errCode == XMLValid::AttNotDefined ||
1547 errCode == XMLValid::AttNotDefinedForElement ||
1548 errCode == XMLValid::SimpleTypeHasChild ||
1549 errCode == XMLValid::ElementNotValidForContent ||
1547 errCode == XMLValid::NotEnoughElemsForCM ||1550 errCode == XMLValid::NotEnoughElemsForCM ||
1548 errCode == XMLValid::EmptyNotValidForContent ||1551 errCode == XMLValid::EmptyNotValidForContent ||
1549 errCode == XMLValid::AttNotDefinedForElement ||1552 errCode == XMLValid::AttNotDefinedForElement ||
1550 errCode == XMLValid::RequiredAttrNotProvided ||1553 errCode == XMLValid::RequiredAttrNotProvided ||
1551 errCode == XMLValid::AttributeNotQualified ||1554 errCode == XMLValid::AttributeNotQualified ||
1552 errCode == XMLValid::ElementNotQualified) )1555 errCode == XMLValid::ElementNotQualified) &&
1556 !(theParentStack &&
1557 errCode == XMLValid::ElementNotDefined)
1558 )
1553 return;1559 return;
15541560
1555 theErrorOccurred = true;1561 theErrorOccurred = true;
15561562
=== added file 'test/rbkt/Queries/zorba/schemas/extracontent.xsd'
--- test/rbkt/Queries/zorba/schemas/extracontent.xsd 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/extracontent.xsd 2012-01-06 13:45:29 +0000
@@ -0,0 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
3 targetNamespace="http://www.zorba-xquery.org/schema" xmlns="http://www.zorba-xquery.org/schema"
4 elementFormDefault="qualified">
5
6 <xs:element name="root" type="xs:anySimpleType"/>
7
8
9</xs:schema>
010
=== added file 'test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec'
--- test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.spec 2012-01-06 13:45:29 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:XQDY0027
02
=== added file 'test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq'
--- test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-attInSimpleContent-err.xq 2012-01-06 13:45:29 +0000
@@ -0,0 +1,9 @@
1import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
2import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3
4declare revalidation lax;
5
6declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns="http://www.zorba-xquery.org/schema" aa="aa">
8</root>};
9$x/@*
010
=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec'
--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.spec 2012-01-06 13:45:29 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:XQDY0027
02
=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq'
--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err2.xq 2012-01-06 13:45:29 +0000
@@ -0,0 +1,10 @@
1import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
2import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3
4declare revalidation lax;
5
6declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns="http://www.zorba-xquery.org/schema">
8<a/>aa
9</root>};
10$x/text()
011
=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec'
--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.spec 2012-01-06 13:45:29 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:XQDY0027
02
=== added file 'test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq'
--- test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-elmInSimpleContent-err3.xq 2012-01-06 13:45:29 +0000
@@ -0,0 +1,10 @@
1import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
2import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3
4declare revalidation lax;
5
6declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns="http://www.zorba-xquery.org/schema">
8<a/>
9</root>};
10$x/text()
011
=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec'
--- test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace-err3.spec 2012-01-06 13:45:29 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:XQDY0027
02
=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq'
--- test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace-err3.xq 2012-01-06 13:45:29 +0000
@@ -0,0 +1,11 @@
1import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
2import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3
4declare revalidation lax;
5
6declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns="http://www.zorba-xquery.org/schema">
8<a/>
9</root>;
10
11schema:validate-in-place($doc);
0\ No newline at end of file12\ No newline at end of file
113
=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec'
--- test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace-err4.spec 2012-01-06 13:45:29 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:XQDY0027
02
=== added file 'test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq'
--- test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/schemas/val-inplace-err4.xq 2012-01-06 13:45:29 +0000
@@ -0,0 +1,11 @@
1import schema namespace d="http://www.zorba-xquery.org/schema" at "extracontent.xsd";
2import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
3
4declare revalidation lax;
5
6declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7 xmlns="http://www.zorba-xquery.org/schema" xx="xx">
8
9</root>;
10
11schema:validate-in-place($doc);
0\ No newline at end of file12\ No newline at end of file

Subscribers

People subscribed via source and target branches