J Changes since XSLT 3.0 (Non-Normative)

J.1 Changes in successive Drafts

The following sections list changes in successive drafts of this specification.

J.1.1 Changes in this Specification: draft A (12 April 2021)

  1. Errata agreed against XSLT 3.0 have been applied.

  2. Support for XPath 4.0 and Functions and Operators 4.0 is required. This notably means that support for XDM arrays is now required.

  3. The xsl:if instruction acquires attributes then and else.

  4. The xsl:when and xsl:otherwise elements can be evaluated using a select expression rather than a contained sequence constructor.

  5. A new xsl:switch instruction is introduced.

  6. The xsl:item-type declaration allows names to be given to item types, which can then be referenced by name. This is particularly useful with record types, introduced in XPath 4.0.

  7. A new xsl:function-library declaration is introduced, allowing functions from multiple different namespaces to be called without using a namespace prefix.

  8. The default namespace for element names and the default namespace for types can now be different, allowing built-in types to be referenced in unprefixed form (as="integer").

  9. New instructions xsl:array and xsl:array-member allow the construction of arrays.

  10. The instructions xsl:for-each, xsl:iterate, and xsl:for-each-group have attributes array and map which can be used in place of the select attribute to allow iteration over arrays or maps rather than sequences.

  11. New pattern syntax ( type(T), record(N, M, N)) allows matching of items by item type.

  12. The xsl:mode declaration acquires an attribute as="sequence-type" which declares the return type of all template rules in that mode.

  13. The xsl:for-each and xsl:apply-templates instructions acquire a separator attribute to allow separators to be inserted into the output.

  14. The xsl:map instruction acquires a new attribute on-duplicates.

  15. The xsl:function declaration allows parameters to be declared as optional, so a single xsl:function declaration can declare functions with multiple arities.

  16. Enclosing modes: The xsl:mode declaration allows contained xsl:template declarations.

  17. Functions that accept a lexical QName as an argument, such as keyFO30, function-availableFO30, element-availableFO30, type-availableFO30, system-propertyFO30, accumulator-beforeFO30, and accumulator-afterFO30, now have the option of supplying an xs:QName value instead.

J.1.2 Changes in this Specification: draft B (date TBA)

  1. The proposed array and map attributes of xsl:for-each, xsl:iterate, and xsl:for-each-group have been dropped. Instead, to iterate over the contents of an array or map, use functions such as array:members and map:key-value-pairs.

  2. The descriptions of basic data types for attributes now avoid using the term lexical space, since in XSD the lexical space contains values after whitespace normalization whereas these descriptions relate to the values as written.

  3. The rules for enclosing modes are corrected: the restriction on referring to the enclosing mode from outside applies to the package, not just to the stylesheet module. In addition, an xsl:apply-templates instruction within an enclosing mode defaults its mode attribute to the enclosing mode.

J.2 Changes in Other Related Specifications

A number of changes affecting XSLT 4.0 have been made in other related specifications. Some of the more significant changes are as follows:

  1. A number of new kinds of ItemType are introduced, for example union types, record types, and enumeration types.

  2. The coercion rules (previously "function conversion rules") allow atomic values of primitive types to be supplied where a restricted type is required: for example if the required type is xs:positiveInteger, it is now acceptable to supply the value 42.

  3. XPath 4.0 introduces abbreviated syntax for conditional expressions (condition ?? action1 !! action2) and for inline functions (-> $x, $y {$x + $y}).