<?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>24310</bug_id>
          
          <creation_ts>2014-01-16 14:51:52 +0000</creation_ts>
          <short_desc>Importing or including xsl:package</short_desc>
          <delta_ts>2014-02-17 16:55:53 +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>
          <cc>cmsmcq</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>98578</commentid>
    <comment_count>0</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-01-16 14:51:52 +0000</bug_when>
    <thetext>It seems that we are not explicit enough about whether we can or cannot use xsl:include or xsl:import to import a stylesheet that has xsl:package as its root.

The spec says:

&quot;The referenced stylesheet module may be any of the four kinds of stylesheet module: that is, it may be standalone or embedded, and it may be standard or simplified. If it is a simplified stylesheet module then it is transformed into the equivalent standard stylesheet module by applying the transformation described in 3.9 Simplified Stylesheet Modules.&quot;[1]

While in essence this seems to exclude stylesheets that are packages, the stylesheet inside a package is considered a &quot;embedded standard stylesheet module&quot;[2] and a referenced stylesheet can also be an embedded standard stylesheet module.

Since locating stylesheet modules is largely implementation dependent, I think it is fair that we be explicit about this. I.e., either explicitly forbid (unless with an xpointer ref), explicitly make it implemention-dependent, or explicitly allow a referenced stylesheet module, in which case we should define whether the xsl:package declarations and the stylesheet, or only the embedded stylesheet is referenced.


[1] http://www.w3.org/TR/xslt-30/#locating-modules
[2] http://www.w3.org/TR/xslt-30/#dt-package-manifest (#2 in the numbered list)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99406</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-01-29 11:18:06 +0000</bug_when>
    <thetext>I think we should explicitly disallow this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99779</commentid>
    <comment_count>2</comment_count>
    <who name="Abel Braaksma">abel.braaksma</who>
    <bug_when>2014-02-05 14:02:59 +0000</bug_when>
    <thetext>If we explicitly disallow this, we break the rule that &quot;a stylesheet is-a package&quot;, as defined with a transformation example under packages for stylesheets that do not have an xsl:package parent.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100145</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-02-10 14:35:59 +0000</bug_when>
    <thetext>The WG discussed this in the face to face meeting in Prague; we agreed to adopt the proposal in comment 1.  (Modules are substitutable for packages, but not vice versa.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100333</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-11 22:05:46 +0000</bug_when>
    <thetext>Detailed changes:

(A) In the intro to 3.12, &quot;XSLT provides two mechanisms to construct a stylesheet from multiple stylesheet modules&quot;, change &quot;stylesheet&quot; to &quot;package&quot;.

(B) In 3.7, Stylesheet Modules, change the categorisation of stylesheet modules, as follows.

The principal stylesheet module of a package may take one of three forms:

* A package manifest, as decribed in 3.6 Packages, which is a subtree rooted at an xsl:package element
* An implicit package, which is a subtree rooted at an xsl:stylesheet or xsl:transform element. This is transformed automatically to a package as described in 3.6 Packages.
* A simplified stylesheet, which is a subtree rooted at a literal result element, as described in 3.9 Simplified Stylesheet Modules. This is first converted to an implicit package by wrapping it in an xsl:stylesheet element using the transformation described in 3.9, and then in an xsl:package element using the transformation described in 3.6.

A stylesheet module other than the principal stylesheet module of a package may take either of two forms:

* A standard stylesheet module, which is a subtree rooted at an xsl:stylesheet or xsl:transform element. 
* A simplified stylesheet, which is a subtree rooted at a literal result element, as described in 3.9 Simplified Stylesheet Modules. This is first converted to a standard stylesheet module by wrapping it in an xsl:stylesheet element using the transformation described in 3.9

Whichever of the above forms a module takes, the outermost element (xsl:package, xsl:stylesheet, or a literal result element) may either be the outermost element of an XML document, or it may be a child of some (non-XSLT) element in a host document. 

[Definition: A stylesheet module whose outermost element is the child of a non-XSLT element in a host document is referred to as an embedded styelsheet module.] See 3.13 Embedded Stylesheet Modules.

(C) Drop the defined term &quot;standalone stylesheet module&quot;.

(D) In 3.12.1 change the paragraph

The referenced stylesheet module may be any of the four kinds of stylesheet module: that is, it may be standalone or embedded, and it may be standard or simplified. If it is a simplified stylesheet module then it is transformed into the equivalent standard stylesheet module by applying the transformation described in 3.9 Simplified Stylesheet Modules.

to read:

The referenced stylesheet module must be either a standard stylesheet module or a simplified stylesheet module. It must not be a package manifest. If it is a simplified stylesheet module then it is transformed into the equivalent standard stylesheet module by applying the transformation described in 3.9 Simplified Stylesheet Modules. 

[The previous paragraph already says the module can be either a complete document or an embedded element within a larger document].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100395</commentid>
    <comment_count>5</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2014-02-12 13:37:24 +0000</bug_when>
    <thetext>The WG discussed this again in Prague and accepted the resolution in comment 4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100770</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-02-17 16:55:53 +0000</bug_when>
    <thetext>The changes proposed have been applied.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>