This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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: "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."[1] While in essence this seems to exclude stylesheets that are packages, the stylesheet inside a package is considered a "embedded standard stylesheet module"[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)
I think we should explicitly disallow this.
If we explicitly disallow this, we break the rule that "a stylesheet is-a package", as defined with a transformation example under packages for stylesheets that do not have an xsl:package parent.
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.)
Detailed changes: (A) In the intro to 3.12, "XSLT provides two mechanisms to construct a stylesheet from multiple stylesheet modules", change "stylesheet" to "package". (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 "standalone stylesheet module". (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].
The WG discussed this again in Prague and accepted the resolution in comment 4.
The changes proposed have been applied.