xsl:package
Defines a set of stylesheet modules that can be compiled as a unit, independently of other packages.
Content: (
(
xsl:expose
| declarations
)*
)
Permitted parent elements: None
Attributes
|
| Optional identifier, not used by the XSLT processor; may be used to identify a package within a larger XML document. |
|
| The name of the package, as an absolute URI, to be used by
|
|
| Version identifier, used to distinguish between different versions of a package. |
|
| Indicates the version of XSLT to which the package manifest conforms. |
|
| Used to request stripping of type
annotations. The default is |
|
| Determines whether of not modes that are
referenced within the package must be explicitly declared. The default is
|
|
| Standard attribute that may appear on
any XSLT element. Defines the default value for the |
|
| Standard attribute that may
appear on any XSLT element. Defines the default value for the
|
|
| Standard attribute that may
appear on any XSLT element. Specifies the default collation used by all XPath
expressions appearing in attributes or text value templates within its scope
(unless overridden by another |
|
| Standard attribute that may appear on any XSLT element. Used to declare the use of extension instructions in a particular namespace. |
|
| Standard attribute that may appear on any XSLT element. Used to designate namespaces as excluded. |
|
| Standard attribute that may appear on
any XSLT element. New in XSLT 3.0. If set to |
|
| Standard attribute that may appear on any XSLT element. Used to conditionally include or exclude elements. The value is an XPath expression that can be evaluated statically. If the effective boolean value is false, then the element and all its descendants are effectively excluded from the stylesheet module. |
|
| Standard attribute that may
appear on any XSLT element. Determines the namespace used for any unprefixed
element name or type name within an XPath expression. The value may be
overridden by another |
Saxon availability
Available in XSLT 3.0. From Saxon 9.8, available in all editions. Implemented in Saxon-PE and Saxon-EE since Saxon 9.7. Available for all platforms.
Notes on the Saxon implementation
Packages are new in XSLT 3.0, and first fully implemented in Saxon 9.7.
Saxon 9.8 introduces new capabilities for defining packages in the configuration file. The configuration file acts as a catalog, mapping package names and versions to the actual locations of source XSLT code for the package, or exported SEF files containing the compiled package.
Alternatively, it is possible to resolve package names and versions programmatically by
setting up a PackageLibrary
.
Packages are available in all Saxon editions. However, only Saxon-EE can be used to export a package in compiled (SEF) form to filestore, and only Saxon-PE or -EE can be used to load a compiled package from filestore. With Saxon-HE, packages must be compiled from source code every time they are used.