xs:include ignored in schemas

Bug #1023120 reported by Chris Hillery
6
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

Chris Hillery (ceejatec)
Changed in zorba:
status: New → Confirmed
assignee: nobody → Cezar Andrei (cezar-andrei)
importance: Undecided → High
milestone: none → 2.7
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

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:
  import schema namespace s = "http://www.28msec.com/project1/schemas/ext" at "extensions.xsd";
  validate { <s:superproduct string="blabla" something="something"/> }

extensions.xsd:
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="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"
    elementFormDefault="qualified">

    <xs:import namespace="http://www.28msec.com/project1/schemas/simple"
             schemaLocation="./simple.xsd"/>

    <xs:element name="superproduct" type="ext:SuperProductType"/>

    <xs:complexType name="SuperProductType">
      <xs:complexContent>
        <xs:extension base="simple:ProductType">
          <xs:attribute name="something" type="xs:string"/>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:schema>

and simple.xsd remains the same:
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.28msec.com/project1/schemas/simple"
            xmlns="http://www.28msec.com/project1/schemas/simple"
    elementFormDefault="qualified">

    <xs:element name="product" type="ProductType"/>
    <xs:complexType name="ProductType">
      <xs:attribute name="string" type="xs:string"/>
    </xs:complexType>
  </xs:schema>

Changed in zorba:
assignee: Cezar Andrei (cezar-andrei) → David Graf (davidagraf)
Revision history for this message
Cezar Andrei (cezar-andrei) wrote :

After more investigation, the bug was actually in Zorba's resolver.

Chris Hillery (ceejatec)
Changed in zorba:
status: Confirmed → Fix Committed
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.