XSLT, XPath and XQuery 4.0 are drafts of the W3C XQuery and XSLT Extensions Community Group (QT4CG, qt4cg.org (https://qt4cg.org/)); the editor's draft is dated 29 September 2026, the last stable snapshot 28 January 2026, and none is on the Recommendation track, so XSLT 3.0 remains the standard. The draft adds xsl:switch, xsl:array and xsl:array-member, xsl:record-type and xsl:item-type for named types, xsl:select, and JNodes for navigating maps and arrays like XML trees. Saxon 13 726,956 (29 May 2026) implements 4.0 features in its commercial PE and EE editions only:
<xsl:stylesheet version="4.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/catalog">
<xsl:switch select="string(book[1]//availability)">
<xsl:when test="'in-stock'">ships today</xsl:when>
</xsl:switch>
</xsl:template>
</xsl:stylesheet>d=~/xml-tools/saxon13 && mkdir -p $d && cd $d && v=SaxonHE13-0
[ -f ${v}J.zip ] ||
curl -fsSLO https://github.com/Saxonica/Saxon-HE/releases/download/$v/${v}J.zip
unzip -oq ${v}J.zip && cd - > /dev/null
java -jar $d/saxon-he-13.0.jar -s:booknest-catalog.xml -xsl:switch.xsl 2>&1 | head -n 2
basex '"BN" => characters(), (1 to 5) => slice(2, 4), () otherwise "default"' | paste -sd' 'Output
Error on line 3 column 56 of switch.xsl: XTSE0010 Unknown XSLT instruction xsl:switch B N 2 3 4 default
BaseX 693,830 already runs much of XPath and XQuery 4.0. Keep production stylesheets on 3.0 until the drafts settle.
XSLT 4 0
XSLT 4.0 is a superset of XSLT 3.0, under active development by the W3C's XQuery and XSLT Extensions Community Group (QT4CG) as a Community Group draft. It is not yet an official W3C Recommendation. The draft specification is published at https://qt4cg.org/specifications/xslt-40/Overview.html.Among the instructions proposed for XSLT 4.0 are:
- <xsl:switch> — a further conditional-branching instruction, alongside the existing <xsl:if> and <xsl:choose>/<xsl:when>/<xsl:otherwise>.
- <xsl:item-type> — part of an enhanced type system that allows more expressive constraints to be declared, in particular for maps and atomic items.
- <xsl:array> and <xsl:array-member> — instructions for constructing array values, extending the existing support for maps (see Streaming, Accumulators and Maps) with equivalent handling for arrays.