xs:include ignored in schemas
Bug #1023120 reported by
Chris Hillery
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
David Graf |
Bug Description
It doesn't appear that <xs:include> elements in schemas have any effect. The definitions in the referenced schema are not loaded, and no error is thrown even if the referenced file does not exist or contains invalid XML.
Related branches
lp:~zorba-coders/zorba/bug1023120-schemaImport
- Chris Hillery: Approve
- David Graf (community): Approve
-
Diff: 106 lines (+49/-4)5 files modifiedsrc/types/schema/schema.cpp (+9/-4)
test/rbkt/ExpQueryResults/zorba/schemas/include.xml.res (+3/-0)
test/rbkt/Queries/zorba/schemas/incl-base.xsd (+13/-0)
test/rbkt/Queries/zorba/schemas/incl-extensions.xsd (+20/-0)
test/rbkt/Queries/zorba/schemas/include.xq (+4/-0)
Changed in zorba: | |
status: | New → Confirmed |
assignee: | nobody → Cezar Andrei (cezar-andrei) |
importance: | Undecided → High |
milestone: | none → 2.7 |
Changed in zorba: | |
status: | Confirmed → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I checked it out and we do return to Xerces the right URL but in the case of include it is never used. There is a Xerces bug that makes the loading of the included URL to be skipped.
As a workaround, you can use import. So you would need to make therse modifications:
test.xq: www.28msec. com/project1/ schemas/ ext" at "extensions.xsd"; "something" /> }
import schema namespace s = "http://
validate { <s:superproduct string="blabla" something=
extensions.xsd: www.w3. org/2001/ XMLSchema" pace="http:// www.28msec. com/project1/ schemas/ ext"
xmlns: ext="http:// www.28msec. com/project1/ schemas/ ext"
xmlns: simple= "http:// www.28msec. com/project1/ schemas/ simple" Default= "qualified" >
<xs:schema xmlns:xs="http://
targetNames
elementForm
<xs:import namespace="http:// www.28msec. com/project1/ schemas/ simple"
schemaLoc ation=" ./simple. xsd"/>
<xs:element name="superproduct" type="ext: SuperProductTyp e"/>
<xs:complexType name="SuperProd uctType" > xs:complexConte nt>
<xs:extension base="simple: ProductType" >
<xs: attribute name="something" type="xs:string"/>
</xs:extension > /xs:complexCont ent> complexType>
<
<
</xs:
</xs:schema>
and simple.xsd remains the same: www.w3. org/2001/ XMLSchema" pace="http:// www.28msec. com/project1/ schemas/ simple" www.28msec. com/project1/ schemas/ simple" Default= "qualified" >
<xs:schema xmlns:xs="http://
targetNames
xmlns="http://
elementForm
<xs:element name="product" type="ProductTy pe"/> complexType>
<xs:complexType name="ProductType">
<xs:attribute name="string" type="xs:string"/>
</xs:
</xs:schema>