xslt 2.4.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global xslt --version 2.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local xslt --version 2.4.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=xslt&version=2.4.0
                    
nuke :add-package xslt --version 2.4.0
                    

xslt

Command-line XSLT 3.0/4.0 processor for .NET. Transform XML documents from the terminal using the PhoenixmlDb XSLT engine.

Installation

dotnet tool install -g xslt

Usage

# Transform XML with a stylesheet
xslt stylesheet.xsl input.xml

# Write output to a file
xslt -o result.html report.xsl data.xml

# Start from a named template (no source needed)
xslt -it main generate.xsl

# Pass parameters
xslt -p year=2026 -p title="Report" style.xsl data.xml

# Read source from stdin
cat data.xml | xslt transform.xsl

# Show timing breakdown
xslt --timing style.xsl large-input.xml

# Validate a stylesheet without running
xslt --dry-run style.xsl

# Stream large files (lower memory)
xslt --stream style.xsl large-input.xml

Features

  • XSLT 3.0/4.0 — packages, streaming, maps/arrays, higher-order functions, JSON output
  • Multiple output methods — XML, HTML, XHTML, text, JSON, adaptive
  • Streaming — process large files without loading into memory
  • xsl:result-document — generate multiple output files in one transform
  • Parameters — pass values from the command line
  • Timing — built-in performance profiling
  • Tracing — log template matching, function calls, and built-in rules

Documentation

Full documentation at phoenixml.dev

License

Apache-2.0

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
2.7.0 0 10/7/2026
2.6.0 53 10/6/2026
2.5.1 74 10/1/2026
2.4.1 91 9/28/2026
2.4.0 65 9/28/2026
2.2.0 318 9/25/2026
2.1.0 77 9/17/2026
2.0.0 77 9/15/2026
1.8.0 70 9/14/2026
1.7.0 77 9/11/2026
1.6.15 80 9/9/2026
1.6.14 84 9/7/2026
1.6.13 96 9/2/2026
1.6.12 91 8/30/2026
1.6.11 78 8/29/2026
1.6.10 85 8/27/2026
1.6.9 255 8/26/2026
1.6.8 82 8/26/2026
1.6.7 88 8/24/2026
1.6.6 94 8/23/2026
Loading failed

Takes **PhoenixmlDb.XQuery 2.4.0** and **PhoenixmlDb.Core 2.0.0**. There is no Xslt 2.3.0; the
engines went from 2.2.0 straight to 2.4.0 to keep the lockstep train together.

XQuery 2.4.0 brings deliberate behaviour changes that reach stylesheets too: `fn:namespace-uri`
returns `xs:anyURI`, and `fn:distinct-values` treats an `xs:anyURI` and an equal `xs:string` as
one value. See XQuery's own 2.4.0 notes. This release carries the matching fix: a stylesheet
function parameter declared `xs:string` now accepts an `xs:anyURI` by promotion (#188). Without
it, passing `namespace-uri()` to such a function failed.

### Fixed — streaming

- **A streamed `xsl:message` lost the items of an `xsl:for-each` in its content** (#175, #148).
- **Templates below an unmatched element did not fire, or could not read their own text** (#176).
- **A buffered matched subtree lost its ancestors** (#177).
- **`has-children()` always answered false** (#178).
- **`xsl:strip-space` was not applied to streamed input, and `xml:space` was ignored** (#183).
- **An element whose template builds its own complete result could close its parent's output
 tag early**, whether written `<a></a>` or `<a/>` (#184, #181).
- **A streamed element's children were processed even when its template never asked for them**
 (#185, #180).
- **`sx-gc-eq-801`**, the last open case of #96 (#186). That closes #96: the three streaming
 sets that fell below their 1.6.10 scores are all back.

### Fixed — `fn:transform` (Martin Honnen, #173)

Two defects, one in each of the two `fn:transform` implementations:

- **From XSLT, `source-location` was never read**, so the transform ran against an empty
 document. It is now honoured, `source-node` still takes precedence when both are given, and a
 relative location resolves against the stylesheet's base URI.
- **From XQuery, `delivery-format='raw'` returned nothing** whenever the inner template
 constructed nodes, with exit code 0. It now returns them.

### Fixed — CLI

**On Windows, `xslt` wrote stdout in the console's legacy code page** (#179, #182). No CLI set
`Console.OutputEncoding`. The visible symptom was `␦` in `--trace` output where `→` belongs. The
serious one was `xslt sheet.xsl in.xml > out.xml` writing code-page bytes under a UTF-8
declaration, which silently corrupted non-ASCII output. Output is now UTF-8 with no BOM. Our CI is
Linux-only and cannot reproduce this, so confirmation comes from Windows users.

### Conformance

**W3C XSLT 3.0: 10,397 / 10,839 (95.92%)**, up 13 from 2.2.0's 10,384 on the same denominator.
Measured with the XQuery source identical to the 2.4.0 library.

The per-set ratchet in `scripts/conformance-baseline.tsv` is raised to this measurement (+62
across 22 sets). It hadn't been raised since before 2.2.0, so most of that is earlier work that
was never recorded, not this release. The xqts rows were not re-measured and are unchanged.