← Back to team overview

zorba-coders team mailing list archive

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

 

Cezar Andrei has proposed merging lp:~zorba-coders/zorba/bugs-912586-912593-912722 into lp:zorba.

Requested reviews:
  Cezar Andrei (cezar-andrei)
  Markos Zaharioudakis (markos-za)
Related bugs:
  Bug #912586 in Zorba: "Zorba Internal Fatal error when applying a PUL changes the type of a typed node"
  https://bugs.launchpad.net/zorba/+bug/912586
  Bug #912593 in Zorba: "Validate in-place causes Zorba Internal Fatal error if a node which might have a simple type contains other nodes"
  https://bugs.launchpad.net/zorba/+bug/912593
  Bug #912722 in Zorba: "A validate lax {}-validated element may cause assertion failures"
  https://bugs.launchpad.net/zorba/+bug/912722

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/bugs-912586-912593-912722/+merge/99767

Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
-- 
https://code.launchpad.net/~zorba-coders/zorba/bugs-912586-912593-912722/+merge/99767
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-03-28 05:19:57 +0000
+++ ChangeLog	2012-03-28 15:51:21 +0000
@@ -9,6 +9,7 @@
   * Fixed bug in window iterator
   * Fixed performance problem with the findNodeSources function of the no-copy rule
   * Fixed bug #872234 (prevent a rewritting to take place in case of sequential expr)
+  * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
 
 
 version 2.2

=== modified file 'src/types/schema/SchemaValidatorFilter.cpp'
--- src/types/schema/SchemaValidatorFilter.cpp	2012-03-28 05:19:57 +0000
+++ src/types/schema/SchemaValidatorFilter.cpp	2012-03-28 15:51:21 +0000
@@ -1545,13 +1545,19 @@
   if(!theStrictValidation &&
      errDomain == XMLUni::fgValidityDomain &&
      errType != XMLErrorReporter::ErrType_Fatal &&
-     !( errCode == XMLValid::ElementNotValidForContent ||
+     !( errCode == XMLValid::AttNotDefined ||
+        errCode == XMLValid::AttNotDefinedForElement ||
+        errCode == XMLValid::SimpleTypeHasChild ||
+        errCode == XMLValid::ElementNotValidForContent ||
         errCode == XMLValid::NotEnoughElemsForCM ||
         errCode == XMLValid::EmptyNotValidForContent ||
         errCode == XMLValid::AttNotDefinedForElement ||
         errCode == XMLValid::RequiredAttrNotProvided ||
         errCode == XMLValid::AttributeNotQualified ||
-        errCode == XMLValid::ElementNotQualified) )
+        errCode == XMLValid::ElementNotQualified) &&
+        !(theParentStack &&
+        errCode == XMLValid::ElementNotDefined)
+  )
     return;
 
   theErrorOccurred = true;

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
+    targetNamespace="http://www.zorba-xquery.org/schema"; xmlns="http://www.zorba-xquery.org/schema";
+    elementFormDefault="qualified">
+    
+    <xs:element name="root" type="xs:anySimpleType"/>
+    
+    
+</xs:schema>

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XQDY0027

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,9 @@
+import schema namespace d="http://www.zorba-xquery.org/schema"; at "extracontent.xsd";
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
+
+declare revalidation lax;
+
+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns="http://www.zorba-xquery.org/schema"; aa="aa">
+</root>};
+$x/@*

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XQDY0027

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,10 @@
+import schema namespace d="http://www.zorba-xquery.org/schema"; at "extracontent.xsd";
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
+
+declare revalidation lax;
+
+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns="http://www.zorba-xquery.org/schema";>
+<a/>aa
+</root>};
+$x/text()

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XQDY0027

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,10 @@
+import schema namespace d="http://www.zorba-xquery.org/schema"; at "extracontent.xsd";
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
+
+declare revalidation lax;
+
+declare variable $x:=validate lax {<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns="http://www.zorba-xquery.org/schema";>
+<a/>
+</root>};
+$x/text()

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XQDY0027

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,11 @@
+import schema namespace d="http://www.zorba-xquery.org/schema"; at "extracontent.xsd";
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
+
+declare revalidation lax;
+
+declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns="http://www.zorba-xquery.org/schema";>
+<a/>
+</root>;
+
+schema:validate-in-place($doc);
\ No newline at end of file

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,1 @@
+Error: http://www.w3.org/2005/xqt-errors:XQDY0027

=== 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-03-28 15:51:21 +0000
@@ -0,0 +1,11 @@
+import schema namespace d="http://www.zorba-xquery.org/schema"; at "extracontent.xsd";
+import module namespace schema = "http://www.zorba-xquery.com/modules/schema";;
+
+declare revalidation lax;
+
+declare variable $doc:=<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+    xmlns="http://www.zorba-xquery.org/schema"; xx="xx">
+
+</root>;
+
+schema:validate-in-place($doc);
\ No newline at end of file


Follow ups