xslt 1.6.5
See the version list below for details.
dotnet tool install --global xslt --version 1.6.5
dotnet new tool-manifest
dotnet tool install --local xslt --version 1.6.5
#tool dotnet:?package=xslt&version=1.6.5
nuke :add-package xslt --version 1.6.5
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 | Versions 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. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.6.10 | 28 | 8/27/2026 |
| 1.6.9 | 204 | 8/26/2026 |
| 1.6.8 | 38 | 8/26/2026 |
| 1.6.7 | 55 | 8/24/2026 |
| 1.6.6 | 60 | 8/23/2026 |
| 1.6.5 | 54 | 8/22/2026 |
| 1.6.4 | 82 | 8/16/2026 |
| 1.6.3 | 66 | 8/14/2026 |
| 1.6.2 | 57 | 8/13/2026 |
| 1.6.1 | 71 | 8/4/2026 |
| 1.6.0 | 73 | 7/31/2026 |
| 1.5.0 | 74 | 7/27/2026 |
| 1.4.25 | 77 | 7/17/2026 |
| 1.4.24 | 72 | 7/14/2026 |
| 1.4.23 | 90 | 7/12/2026 |
| 1.4.22 | 83 | 7/10/2026 |
| 1.4.21 | 75 | 7/9/2026 |
| 1.4.20 | 65 | 7/9/2026 |
| 1.4.19 | 80 | 7/9/2026 |
| 1.4.18 | 71 | 7/8/2026 |
Seven engine fixes, all found by running real stylesheets rather than the test suites. The
largest of them unblocked 60 of the 162 XSpec suites, which had been failing before they could
execute a single test.
### Fixes
- **`xsl:copy` carries the source element's complete IN-SCOPE namespaces, not only the `xmlns`
declarations written on it.** XSLT 3.0 §11.9.1 requires a namespace node on the copy for every
namespace node of the original. Emitting only the local declarations is usually
indistinguishable, because the copy lands in a tree whose ancestors re-supply the rest — but
not when nothing re-supplies them. Under `inherit-namespaces="no"`, or for a detached copy, the
copy kept only the prefix of its own name, and a later `resolve-QName` against it failed with
`FONS0004` for a prefix the source plainly had. XSpec's compiler is exactly this shape:
`x:combine` wraps the combined document in `<xsl:element inherit-namespaces="no">` and the
compiler then copies scenarios out of that tree and resolves `@function` / `@template` / `@as`
against the copies. Measured across the XSpec suites: suites stuck at Compile 99 → 42, reaching
Run 39 → 84, running to Completion 24 → 36, with 58 suites advancing a stage and none
regressing.
- **`xsl:result-document` targeting the principal output returns the empty sequence.** Its content
is a result document and never contributes to the containing sequence constructor (§26.1). One
with an `href` was already redirected correctly; one targeting the principal output wrote into
the same buffer an `as=`-typed body slices for its return value, so its content was counted as
the template's result. A template declared `as="empty-sequence()"` around a bare
`xsl:result-document` — the shape XSpec generates for its report — raised `XTTE0505: expected
zero items, got 1`.
- **`xsl:result-document` content contributes no accumulated items either.** The companion to the
above: the content ran with the enclosing sequence accumulator still installed, so an
`xsl:sequence` *inside* a result document could still leak an item into an enclosing typed body.
- **The collected-attribute stack is restored bottom-first.** Four seams saved the stack to a
`List`, cleared it, and pushed the list back — but `Stack<T>` enumerates top-first, so the
restore reversed it. Harmless at nesting depth 1, which is why it survived; at depth ≥ 2 the
enclosing element sealed against its parent's buffer, losing every attribute created by the
`xsl:attribute` instruction while the parent silently gained them, and every element built
afterwards was shifted by one. Literal and AVT attributes never enter that stack, so ordinary
stylesheets were unaffected and only code generators — which must compute attribute names and
values — fell in. It accounted for `XTSE0010` in 62 XSpec suites: a generated
`<xsl:stylesheet>` with no `@version`, `Q{uri}` names with an empty local part, and valueless
`xsl:attribute` elements were one defect wearing three masks.
- **`fn:transform`'s `initial-template` option is an `xs:QName`, not a local name.** It was read
as a string, discarding the namespace, so a namespaced entry point could not be selected. The
adjacent `initial-function` option already handled this correctly.
- **An `xsl:function` with no `as=` returns text NODES for text its body produces.** The typed
form already did; the untyped form handed back a plain string, so `boolean()` over a sequence
of such results raised `FORG0006`.
- **`for-each-group` with `group-by` over a grounded population is streamable.** The classifier
reported every `group-by` as not-streamable, which forced whole-input buffering even where the
population is already materialised. A correctness fix in the classifier; runtime behaviour is
unchanged.
### Version alignment
From 1.6.5 the engine libraries and the CLI tools built on them share a single version, so a
matching number means a compatible set. See `PhoenixmlDb.Core` 1.6.5 for the rationale.