<?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>30390</bug_id>
          
          <creation_ts>2019-01-14 14:27:01 +0000</creation_ts>
          <short_desc>[XSLT30] xsl:accept influences the declared visibility, but this is not specified in the section on xsl:expose</short_desc>
          <delta_ts>2019-02-15 20:34:16 +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>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="Abel Braaksma">abel.online</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          
          
          <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>129474</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.online</who>
    <bug_when>2019-01-14 14:27:01 +0000</bug_when>
    <thetext>Consider:

* Package P having a public function (declared or via xsl:expose) p:myFunction
* Package Q uses P and has &lt;xsl:accept visibility=&quot;public&quot; name=&quot;p:myFunction&quot; /&gt;
* There is no xsl:expose in Q
* Package R uses Q

The question arises whether p:myFunction is visible from R. The text under xsl:accept suggests it is, but under the xsl:expose section (3.5.3.1 Visibility of Components), we write:

&quot;When a component is declared within a particular package, its visibility, which affects how it can be used in other (using) packages, depends on two factors: the value of the visibility declaration on the declaration itself (if present), and the rules given in the xsl:expose declarations of the package manifest.&quot;

The following paragraphs go into more detail, but we mention nowhere (I think) what happens when none of this is true (that is: when it is not declared &apos;on the component declaration&apos; *and* there is no matching xsl:expose), but xsl:accept is present.

I think the section on xsl:accept makes clear that &quot;public&quot; in a valid xsl:accept declaration means &quot;public to the current package and its using packages&quot;.

We may benefit from explicitly stating that &quot;on the declaration itself&quot; includes when declared through xsl:accept and the declaration itself is not available anymore (because it is used from a deeper linked package).

An alternative is that we write the section on xsl:accept in terms of changing the &quot;declared visibility&quot;, which itself could be defined recursively.

I don&apos;t think the spec intended to *require* an extra xsl:expose when you already use xsl:accept on a component from a used package.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>129507</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2019-02-15 20:34:16 +0000</bug_when>
    <thetext>I&apos;m not convinced there is a bug here.

If there is no xsl:expose in Q, then (a) it&apos;s hard to see how the xsl:expose rules are relevant, and (b) the component isn&apos;t declared within Q, so rules starting &quot;When a component is declared within [Q]...&quot; are clearly immaterial.

Most of the section on xsl:expose discusses how it applies to components declared within the package containing xsl:expose, but we also have a paragraph explaining how it affects components brought in from a used package. Inverting P and Q to match the terminology of this bug report, we say:

For a component accepted into a package Q from another package P, the visibility of the component in Q (which primarily affects how it can be used in a package R that uses Q) depends on the visibility declared in the relevant xsl:accept or xsl:override element in Q (see 3.5.3.2 Accepting Components); this in turn has a default that depends on the visibility of the corresponding component in P. In this case the visibility is unaffected by any xsl:expose declaration in Q.

That last sentence suggests to me that xsl:expose ONLY applies to components actually declared within the containing package. This means that perhaps

[ERR XTSE3020] It is a static error if a token in the names attribute of xsl:expose, other than a wildcard, matches no component in the containing package.

should say

[ERR XTSE3020] It is a static error if a token in the names attribute of xsl:expose, other than a wildcard, matches no component that is declared in the containing package.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>