<?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>29233</bug_id>
          
          <creation_ts>2015-10-23 20:13:31 +0000</creation_ts>
          <short_desc>[xslt30ts] package-017: duplicate function declaration</short_desc>
          <delta_ts>2016-02-16 14:47:00 +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 Test Suite</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</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="Abel Braaksma">abel.online</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>123881</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-23 20:13:31 +0000</bug_when>
    <thetext>I believe that test case package-017 should fail because both the functions function1 and function2 appear in the using package as duplicates.

The xsl:accept has no effect (it accepts one of the functions explicitly, but this is exactly the same as the default action, and the other function is accepted implicitly). 

So both use-package declarations create a pair of functions function1 and function2, as a result of which the using package contains duplicate components.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123882</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-23 20:15:20 +0000</bug_when>
    <thetext>The same problem affects package-018</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123949</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-10-26 15:54:23 +0000</bug_when>
    <thetext>For some reason I thought that if you have a list of xsl:accepts that it implies that you only accept the explicitly mentioned components. This test failed with my implementation for the reasons you mentioned.

I found the rule:

&lt;quote&gt;
For every component CQ in package Q that is not matched by any xsl:override or xsl:accept element in the package manifest of P, there will be a corresponding component CP in package P that has the same symbolic identifier and declaration as CQ. The visibility of CP will be the same as the visibility of CQ, except that where the visibility of CQ is private, the visibility of CP will be hidden.
&lt;/quote&gt;

In other words, the default is that if you don&apos;t explicitly hide something, everything is accepted.

## Package-017

The reason behind making this test was to find out what happens if you have two xsl:use-package pointing to the same package, whether or not this is possible at all and if so, how it should behave.

I think the intended effect can be found by writing the stylesheet as follows:

&lt;xsl:use-package name=&quot;urn:use-me&quot; package-version=&quot;*&quot;&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function1&quot; visibility=&quot;public&quot;/&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;*&quot; visibility=&quot;hidden&quot; /&gt;
&lt;/xsl:use-package&gt;

&lt;xsl:use-package name=&quot;urn:use-me&quot; package-version=&quot;0.1&quot;&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function2&quot; visibility=&quot;public&quot;/&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;*&quot; visibility=&quot;hidden&quot;/&gt;
&lt;/xsl:use-package&gt;

Since the wild-card matches components unless a specific match is available, I think this is legal, and the effect should be that there is no conflict or error.

## Package-018

A similar effect can be reached with package-018, where the attempt was instead to try to create two conflicting xsl:accepts that are not really conflicting (components are not conflicting if they are hidden). Reading the rules again, I am not sure this is allowed:

&lt;xsl:use-package name=&quot;urn:use-me&quot; package-version=&quot;*&quot;&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function1&quot; visibility=&quot;public&quot;/&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function2&quot; visibility=&quot;hidden&quot;/&gt;
&lt;/xsl:use-package&gt;

&lt;xsl:use-package name=&quot;urn:use-me&quot; package-version=&quot;0.1&quot;&gt;        
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function2&quot; visibility=&quot;public&quot;/&gt;
    &lt;xsl:accept component=&quot;function&quot; names=&quot;pkg:function1&quot; visibility=&quot;hidden&quot;/&gt;
&lt;/xsl:use-package&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123950</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2015-10-26 15:58:19 +0000</bug_when>
    <thetext>(PS: we don&apos;t specifically say that it is allowed or disallowed to have two xsl:use-packages pointing to the same package, and if not disallowed, it is allowed, I think and their contents merged)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123956</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-10-26 17:30:56 +0000</bug_when>
    <thetext>I think it definitely IS allowed to have two use-package elements identifying the same package provided that it doesn&apos;t result in any duplicate declarations. Unless the package exposes nothing, the only way you can avoid duplicate declarations is by selectively accepting the components it exposes. So it&apos;s legal to do:

&lt;xsl:use-package name=&quot;math&quot;&gt;
  &lt;xsl:accept component=&quot;function&quot; name=&quot;*&quot; visibility=&quot;hidden&quot;/&gt;
  &lt;xsl:accept component=&quot;function&quot; name=&quot;sine&quot; visibility=&quot;public&quot;/&gt;
&lt;/xsl:use-package&gt;

&lt;xsl:use-package name=&quot;math&quot;&gt;
  &lt;xsl:accept component=&quot;function&quot; name=&quot;*&quot; visibility=&quot;hidden&quot;/&gt;
  &lt;xsl:accept component=&quot;function&quot; name=&quot;cosine&quot; visibility=&quot;public&quot;/&gt;
&lt;/xsl:use-package&gt;

I can certainly see the utility in saying that if there is at least one xsl:accept element, then everything that is not accepted is hidden. But that&apos;s not the way it is currently defined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>125101</commentid>
    <comment_count>5</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2016-02-16 14:47:00 +0000</bug_when>
    <thetext>As discussed today, we decided to close this bug as it was resolved in the committed changes of 29 Oct 2016.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>