validate-in-place can break other update primitives

Bug #872796 reported by Federico Cavalieri
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Federico Cavalieri

Bug Description

The validate-in-place function can make other update primitives uneffective.

The following query should return new new but it returns old new.

import module namespace schema = "http://www.zorba-xquery.com/modules/schema";
import schema namespace d="http://www.example.com/doc" at "test24.xsd";
import module namespace file = "http://expath.org/ns/file";
declare revalidation lax;

variable $doc:=<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.zorba-xquery.org/schema">
    <a>old</a>
</item>;

(
  schema:validate-in-place($doc),
  replace value of node $doc//*:a with "new"
);

variable $res1:=string($doc//*:a);

(
  replace value of node $doc//*:a with "new"
);

($res1,string($doc//*:a))

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

The schema
<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="item">
    <xs:complexType>
      <xs:sequence>
               <xs:element name="a" type="xs:string"/>
             </xs:sequence>
   </xs:complexType>
 </xs:element>

</xs:schema>

Changed in zorba:
assignee: nobody → Federico Cavalieri (fcavalieri)
importance: Undecided → High
Changed in zorba:
status: New → Fix Released
Changed in zorba:
status: Fix Released → Fix Committed
milestone: none → 2.1
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.