Validate in place applied on non-root element produces an invalid xdm instance
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Federico Cavalieri |
Bug Description
If validate-in-place is called on a non-root element the resulting xdm instance can be invalid since it may contain typed nodes as descendant of untyped nodes.
Schema
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://
targetNamespace="http://
elementFormDef
<xs:element name="root" type="rootType"/>
<xs:complexType name="rootType">
<xs:sequence>
<xs:element name="root" type="rootType" minOccurs="0"/>
<xs:element name="a" type="xs:string"/>
<xs:element name="b" type="xs:string"/>
<xs:element name="c" type="xs:string"/>
</xs:sequence>
<xs:attribute name="attr" type="xs:string"/>
</xs:complexType>
</xs:schema>
Query
import module namespace schema = "http://
import module namespace doc = "http://
import schema namespace d="http://
declare revalidation lax;
declare construction strip;
declare variable $doc2:=<root xmlns:xsi="http://
xmlns="http://
<root>
<a/>
<b/>
<c/>
</root>
<a/>
<b/>
<c/>
</root>;
schema:
(schema:
Result
xs:untyped rootType
Related branches
- Markos Zaharioudakis: Approve
- Cezar Andrei: Approve
-
Diff: 168 lines (+64/-0)11 files modifiedChangeLog (+1/-0)
include/zorba/pregenerated/diagnostic_list.h (+2/-0)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+4/-0)
src/diagnostics/diagnostic_en.xml (+4/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+3/-0)
src/diagnostics/pregenerated/dict_en.cpp (+1/-0)
src/runtime/schema/schema_impl.cpp (+6/-0)
src/store/naive/simple_pul.cpp (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq (+23/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd (+18/-0)
Changed in zorba: | |
status: | New → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |