[xsl] [XSLT 3.0] Question about the simplified syntax of a package

Subject: [xsl] [XSLT 3.0] Question about the simplified syntax of a package
From: "Dimitre Novatchev dnovatchev@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Nov 2014 21:53:35 -0000
In the latest Last Call of the XSLT 3.0 specification
(http://www.w3.org/TR/2014/WD-xslt-30-20141002/#packages), we read :

"A package that does not itself expose any components or use any
library packages may be written using a simplified syntax: the
xsl:package element is omitted, and the xsl:stylesheet or
xsl:transform element is now the outermost element of the stylesheet
module. For compatibility reasons, all the named templates and modes
declared in the package are made public. More formally, the principal
stylesheet module of the top-level package may be expressed as an
xsl:stylesheet or xsl:transform element, which is equivalent to the
package represented by the output of the following transformation,
preserving the base URI of the source:

 <xsl:transform version="3.0"

    <xsl:namespace-alias stylesheet-prefix="t" result-prefix="xsl"/>

    <xsl:template match="xsl:stylesheet|xsl:transform">
      <t:package declared-modes="no">
        <xsl:copy-of select="@*"/>
        <t:expose component="mode" names="*" visibility="public"/>
        <t:expose component="template" names="*" visibility="public"/>
        <xsl:copy-of select="node()"/>
I have two questions:

1. As we see from the code above, only modes and named templates will
be exposed in the equivalent xsl:package.

Is it correct to conclude that if the principal stylesheet module
contains any components of type: function, attribute-set, accumulator,
keys and global variables / parameters, these are not exposed and
cannot be accessed from a using package? If so, what was the reason
for this decision?

2. Because the produced by the transformation above equivalent package
doesn't have any "name" or "package-version" attributes specified, how
should an <xsl:use-package> in a using package reference the package
generated by the transformation?

Dimitre Novatchev

Current Thread