XSLT 3.0 conformance
The XSLT 3.0 specification is currently a last call Working Draft.
Broadly speaking:
-
Saxon-HE does not implement any XSLT 3.0 features.
-
Saxon-PE implements most XSLT 3.0 (and XPath 3.0) features, with the notable exceptions of schema-awareness, streaming, and packages.
-
Saxon-EE implements additional features relating to schema-awareness and streaming (processing of a source document without constructing a tree in memory). There is a rudimentary implementation of packages, but at this stage it is not recommended for production use.
For information on streaming, see Streaming of Large Documents.
The release of Saxon 9.6 is synchronized with the publication of a Last Call Working Draft of XSLT 3.0, published on 2 October 2014 (at http://www.w3.org/TR/xslt-30/). The implementation of Saxon 9.6 is closely aligned with this draft but not all features are implemented.
XSLT 3.0 features are not available unless explicitly requested. The request can be made by
setting -xsltversion:3.0
on the command line, by calling
setXsltLanguageVersion()
on the XsltCompiler
object, or by use of the
configuration setting FeatureKeys.XSLT_VERSION
(see Configuration Features). Setting
version="3.0"
on the xsl:stylesheet
element is recommended,
but is not sufficient on its own.
The exception to the above is that new functions in separate namespaces (the
map
and math
namespaces in particular) do not require XSLT 3.0
to be enabled, since a conformant 2.0 processor can handle them as extension functions.
When XSLT 3.0 is activated, XPath expressions in the stylesheet may use all constructs defined in XPath 3.0 Recommendation of 8 April 2014.
XSLT 3.0 features implemented in Saxon 9.6 include the following. The links are to sections of the documentation that summarize the usage of each element, and that describe the current state of the Saxon implementation.
-
The xsl:iterate instruction
-
The xsl:mode declaration
-
The xsl:merge instruction
-
The xsl:try instruction
-
The xsl:evaluate instruction
-
The xsl:stream instruction (Saxon-EE only)
-
The xsl:fork instruction (Saxon-EE only)
-
The xsl:accumulator instruction
-
The xsl:assert instruction
-
The xsl:map and xsl:map-entry instructions
-
The
select
attribute of the xsl:copy instruction -
The
composite
attribute of the xsl:for-each-group instruction -
The
static
attribute of the xsl:variable and xsl:param declarations -
The
[xsl:]on-empty
attribute of xsl:element, xsl:copy, and literal result elements -
The copy-of() and snapshot() functions
-
The syntax of patterns has been generalized; most of the new XSLT 3.0 features are implemented but the implementation may be incomplete.
Maps, as defined in the draft XSLT 3.0 specification, are implemented as an extension to XPath 3.0. For details see Maps in XPath 3.0.
Some of the new XSLT 3.0 features that are NOT yet implemented include:
-
The
xsl:context-item
andglobal-context-item
declarations -
The
composite
attribute of thexsl:key
declaration
Packages are partially implemented, but the implementation is not complete and has not been
comprehensively tested. The facility is therefore not recommended for production use. The
xsl:package
, xsl:use-package
, and xsl:override
elements are implemented. The visibility
attribute is implemented. Only named
components (not template rules) may be overridden in a using package. The
xsl:accept
and xsl:expose
elements are recognized, but have no
useful effect. The new scheme for package version identifiers is not implemented. Packages
can be independently compiled using the Java API, but the compiled package exists only as
an object in memory (it cannot be saved to filestore), and packages that are used together
must be compiled under the same Saxon instance (specifically, the same
Configuration
).