This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17574 - [XSD 1.1] xs:override transformation and xs:import
Summary: [XSD 1.1] xs:override transformation and xs:import
Status: ASSIGNED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: needsDrafting
Depends on:
Blocks:
 
Reported: 2012-06-22 08:55 UTC by Michael Kay
Modified: 2012-06-29 16:25 UTC (History)
1 user (show)

See Also:


Attachments
This is the version of override.xsl I am using in Saxon with my attempt to fix this bug (4.33 KB, text/xml)
2012-06-29 16:23 UTC, Michael Kay
Details

Description Michael Kay 2012-06-22 08:55:30 UTC
This arises from a bug report submitted against Saxon by Priscilla Walmsley.

The schema includes something like this:

<xs:schema xmlns:new="ns.new">
<xs:import namespace="ns.new"/>
<xs:override schemaLocation="old.xsd">
  <xs:complexType name="P">
    <xs:sequence>
       <xs:element ref="new:Q"/>
    </xs:sequence>
  </xs:complexType>
</xs:override>
</xs:schema>

The result of applying the override.xsl transformation is a schema document that contains a reference to the name new:Q but does not contain any xs:import declaration for the ns.new namespace (because there was no reference to this namespace in the overridden schema document).

I have fixed the problem by changing the override.xsl transformation so that it copies any xs:import declarations from the "overriding" schema document as well as those from the "overridden" document. However, this is a little crude because there is potential for conflict if both documents contain imports for the same namespace, potentially with different schemaLocations.

In passing I noticed that the override.xsl I am using is a little different from that in the specification. The one in the specification appears to expect the transformation to proceed by executing the named template "perform-override" (though this is nowhere mentioned). The parameters overrideElement and overriddenSchema are given as parameters to this named template rather than as global stylesheet parameters. The standard invocation mechanism for XSLT, however, does not allow parameters to be supplied to a named entry template, only to global stylesheet parameters.

Priscilla's test case can be found at https://dev.saxonica.com/community/issues/1505
Comment 1 Michael Kay 2012-06-29 16:23:59 UTC
Created attachment 1149 [details]
This is the version of override.xsl I am using in Saxon with my attempt to fix this bug

For info I am attaching the copy of override.xsl that I am currently using in Saxon
Comment 2 David Ezell 2012-06-29 16:25:15 UTC
MSM: I think MK's reported behavior is probably a good way forward:
...: copy imports from overriding to output, if the namespace in question is not already imported in the overridden schema document.
...: I might have made the overriding schema document win in case of conflict, but I can live with it either way.

WG believes this is a spec error.