xslt 2.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global xslt --version 2.2.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.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=xslt&version=2.2.0
                    
nuke :add-package xslt --version 2.2.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 63 10/6/2026
2.5.1 75 10/1/2026
2.4.1 94 9/28/2026
2.4.0 66 9/28/2026
2.2.0 322 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 81 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 256 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.2.0** and **PhoenixmlDb.Core 2.0.0**.

XQuery moves with this release and the order matters: that package carries `xs:IDREFS`,
`xs:NMTOKENS` and `xs:ENTITIES` as cast targets (+63 QT3 cases). Had this shipped against the
2.1.0 pin, none of those would have reached anyone installing `PhoenixmlDb.Xslt`.

### Fixed

- **`xsl:expose` selected nothing, silently.** Component names, the value space and the missing
 token forms (#162). **+13 W3C cases.**
- **Three error sites named a neighbouring code** (#155). **+12 W3C cases.**
- **A streamed `group-adjacent` key that returns elements is now rejected** as `XTSE3430`, and a
 streamed `group-adjacent` with an empty key reports `XTTE1100` like its buffered twin rather
 than a misleading `XTDE1071` (#168, #152). Both halves of Martin Honnen's #147.
- **`xsl:sort` and `xsl:key` did not set temporary output state**, so `xsl:result-document`
 inside a sort key ran instead of raising `XTDE1480` (#158).
- **The runner never set a base output URI**, so every `current-output-uri()` case saw `()` (#159).
- **`regex-group()` returned the empty sequence inside a pattern** (#154).
- **A text node returned by `xsl:function` was not a real node** — axis steps raised `XPTY0020`
 naming an internal type (#151).
- **Static declarations now come into scope in declaration order** (#167).
- **The streaming scanner descends into `xsl:map` and `xsl:map-entry`** (#128).
- **`xsl:use-package` whitespace declarations have a relative import precedence** (#145).

### Performance

**A match pattern carrying any predicate was O(n²) in sibling count** (#169). The predicate's
content was irrelevant — `w:p[@zzz]` cost the same as one walking every descendant twice, because
the cost was establishing `position()`/`last()` context for a predicate that cannot observe it.
Measured on the issue's own repro: **12.6× faster at n=4000**, and a predicate now costs 3% over
having none rather than 250%.

### Conformance

**W3C XSLT 3.0: 10,384 / 10,839 (95.80%)**, up 37 passes from 2.1.0's 10,347.

The denominator is unchanged, so this is the engine doing more rather than cases leaving the
count. Measured on this commit against the **published** `PhoenixmlDb.XQuery 2.2.0` package — not
sibling source — so it describes the artifact being released.

### Known limitations

- A streamed `xsl:message` loses items produced by `xsl:for-each` in its content (#148). The
 obvious fix makes it worse: the message loses its constants too.
- Three streaming sets remain below their 1.6.10 scores (#96). Not a regression — those cases
 passed by not streaming at all until `streamable="true"` began actually streaming.

> **Correction (2026-09-04).** Every W3C XSLT conformance figure recorded in this file before
> this date is overstated. Tests expecting a specific error code were scored as passes whenever
> the transform threw anything at all, because both conformance runners read the expected code
> from element text when the corpus writes it as an attribute. Re-measured against the same
> corpus, the figure **on that date** was **10,020/10,630 (94.3%)**. The historical entries below
> are left as written — they record what was believed at the time. See BUGS.md entry 28.
>
> That 94.3% is itself now historical; do not quote it as current. The live figure is in
> `README.md` and in the generated `STATUS.md`, each carrying its own measurement date.