<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>29453</bug_id>
          
          <creation_ts>2016-02-14 10:11:44 +0000</creation_ts>
          <short_desc>[xslt30ts] package-019 - use package via xsl:include</short_desc>
          <delta_ts>2016-10-06 18:42:27 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Candidate Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>abel.braaksma</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>125010</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-02-14 10:11:44 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125011</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-02-14 10:16:54 +0000</bug_when>
    <thetext>Also affects package-020X

Also, package-020c.xsl is referenced in test package-020c, but is not committed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125054</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-02-15 16:48:19 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125160</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-02-19 12:51:19 +0000</bug_when>
    <thetext>The changes to the spec have been applied.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125326</commentid>
    <comment_count>4</comment_count>
    <who name="Max Toro">maxtoroq</who>
    <bug_when>2016-03-02 15:43:15 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125328</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-03-02 15:54:57 +0000</bug_when>
    <thetext>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&apos;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&apos;s what packages are designed for.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126584</commentid>
    <comment_count>6</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-05-26 15:48:22 +0000</bug_when>
    <thetext>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)
&gt; Also affects package-020X
&gt; 
&gt; Also, package-020c.xsl is referenced in test package-020c, but is not
&gt; 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.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>