This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Perhaps a spec issue, perhaps a test issue. The spec says in 3.5.2: When components in one package reference components in another, the dependency of the first package on the second must be represented by an xsl:use-package element in the package manifest of the first package. This appears to prohibit what this test is attempting, which is to have the xsl:use-package declaration in an included module.
Also affects package-020X Also, package-020c.xsl is referenced in test package-020c, but is not committed.
We decided that we should allow an xsl:use-package to appear within an included stylesheet module but not within an imported stylesheet module (to avoid any issues of multiple declarations with different precedence). A new error code needs to be defined.
The changes to the spec have been applied.
It would be very helpful if you could elaborate on the import precedence issues, the spec already disallows declarations that are homonymous with accepted and overriding components. Disallowing xsl:use-package on imported modules is a limitation for hiding complexity, imagine hundreds of stylesheets that import one common module, with this limitation all stylesheets need to be aware of and explicitly use a package. Another argument is keeping xsl:use-package close to where the used package components are referenced, e.g. if the accepted components are used in an imported module and not the principal module.
In general if a declaration occurs in an imported module then it can always be overridden in an importing module. An xsl:import in an imported module imports declarations with different precedence from the same xsl:import appearing in an importing module, and similar rules apply to an xsl:include in an imported module. We don't want to handle the complexity of use-package bringing components in at anything other than the highest import precedence of the using package, because the rules just get too complicated. We could define it so that xsl:use-package creates components at the highest import precedence regardless where it appears, but (a) that would be inconsistent with the usual behaviour of xsl:import, and (b) it would reduce our flexibility to introduce refinements in the future. In the scenario you describe where hundreds of stylesheet use one common module, we would encourage you to turn that module into a package so that it can be separately compiled and reused. That's what packages are designed for.
For reference, the new error mentioned in comment 2 is: [ERR XTSE3008] It is a static error if an xsl:use-package declaration appears in a stylesheet module that is not in the same stylesheet level as the principal stylesheet module of the package. (In reply to Michael Kay from comment #1) > Also affects package-020X > > Also, package-020c.xsl is referenced in test package-020c, but is not > committed. Changes have been applied to the tests and committed. New error code is now used for using xsl:import with an xsl:use-package element.