<?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>26781</bug_id>
          
          <creation_ts>2014-09-11 00:18:58 +0000</creation_ts>
          <short_desc>[XSLT30] An argument / proposal for removing xsl:expose</short_desc>
          <delta_ts>2015-10-29 09:50:33 +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>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</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="Abel Braaksma">abel.braaksma</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>111370</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-11 00:18:58 +0000</bug_when>
    <thetext>When xsl:stylesheet was a child of xsl:package it seemed to make sense to have an extra layer of indirection for exposing elements of that child to the outside world. Now that xsl:stylesheet is not a child anymore, I think the need for xsl:expose is gone.

The only things xsl:expose can do is hide things:
- change public to private or final
- change final to private

These options are already available in the visibility attribute of the declarations. Having the visibility attribute present, exposes them. If someone wants a declaration hidden, they can change that attribute. I don&apos;t see the need (anymore) for having an extra declaration that can change the already statically present visibility.

The biggest use-case, I think, was to allow, at package level, to hide parts that were introduced with xsl:use-package. However, that declaration has an xsl:accept (by using hidden or absent), in which the user can decide to accept or not certain items. Again, two ways to achieve, I think, exactly the same.

In short: my proposal is to drop xsl:expose. It also gets rid of potential vs exposed visibility, which I think is a good thing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111379</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-09-11 08:52:43 +0000</bug_when>
    <thetext>I don&apos;t think the use case for xsl:expose has gone away. The rationale was to allow an existing collection of stylesheet code to be packaged without modifying the code, by writing a package manifest which you now write in the form

&lt;xsl:package ...&gt;

  &lt;xsl:import href=&quot;existing-code.xsl&quot;/&gt;

  &lt;xsl:expose ...&gt;

&lt;/xsl:package&gt;

Using xsl:expose here is more self-contained than trawling through all the code adding visibility attributes; it&apos;s more appropriate when you don&apos;t own that code, and it&apos;s probably a sensible approach if that code has to continue working under XSLT 2.0.

The removal of the xsl:stylesheet level changes the way this manifest is written, but it doesn&apos;t alter the need for the feature. We could argue that the facility is &quot;a bridge too far&quot; and that the need is not strong enough to justify the complexity, but that&apos;s a different argument.

I&apos;m very reluctant to spend time on re-examining requirements at this stage, or we will never finish.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111384</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-11 12:28:47 +0000</bug_when>
    <thetext>&gt; I&apos;m very reluctant to spend time on re-examining requirements at 
&gt; this stage, or we will never finish.

I understand, and I feel the same.

However, I think that either the requirement is not met (in which case we should fix it, either by removing it, if the requirement has gone, or by amending it), or I misread the spec. 

If you do as you say:

&lt;xsl:package ...&gt;

  &lt;xsl:import href=&quot;existing-code.xsl&quot;/&gt;

  &lt;xsl:expose ...&gt;

&lt;/xsl:package&gt;

you end up with the default potential visibility, which is private. It is only permitted, with xsl:expose, to change the potential visibility *down* (less public), not *up*. That means that private can be &quot;changed&quot; to private, but cannot be made public.

In other words, using xsl:expose in the above example has no effect, unless we change the default visibility from private to public (I&apos;d probably argue against that, but it would, as a by-product, solve the issues with xsl:param&apos;s visibility).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112271</commentid>
    <comment_count>3</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-09-26 17:15:04 +0000</bug_when>
    <thetext>As per the minutes of the XSL WG of telcon 2014-09-25 (https://lists.w3.org/Archives/Member/w3c-xsl-wg/2014Sep/0053.html, members only), the recorded decision was:

&lt;quote&gt;
RESOLVED: to close bug 26781 by adopting proposal (a) of ABr&apos;s message
[1]: if no visibility attribute is present on a declaration, the
visibility of a component is determined by the xsl:expose declarations
at the package level; expose can lower but not raise the level of
visibility (retaining current rules). However, we did not adopt the
proposal to rename xsl:expose.

[1] https://lists.w3.org/Archives/Member/w3c-xsl-wg/2014Sep/0032.html

The result of this is that the priority of visibility specifications
is:

  - xsl:expose with explicit name (if more restrictive than the
    explicit value on the declaration)
  - visibility on the declaration itself
  - xsl:expose with wildcard
  - private

We agreed to mark bug 26781 as RESOLVED.
&lt;/quote&gt;

This means that, given:

&lt;xsl:function name=&quot;my:fun&quot;&gt;...&lt;/xsl:function&gt;

that the following will make this public:

1) &lt;xsl:expose names=&quot;*&quot; visibility=&quot;public&quot; /&gt;
2) &lt;xsl:expose names=&quot;my:*&quot; visibility=&quot;public&quot; /&gt;
3) &lt;xsl:expose names=&quot;my:fun&quot; visibility=&quot;public&quot; /&gt;

This also means that, given:

&lt;xsl:function name=&quot;my:fun&quot; visibility=&quot;private&quot;&gt;...&lt;/xsl:function&gt;

that the same statements (1) and (2) above have no effect, and (3) will raise an error (TBD).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112833</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-10-08 15:53:39 +0000</bug_when>
    <thetext>Marking this resoved (see comment #3)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>