xslt 1.6.4
dotnet tool install --global xslt --version 1.6.4
dotnet new tool-manifest
dotnet tool install --local xslt --version 1.6.4
#tool dotnet:?package=xslt&version=1.6.4
nuke :add-package xslt --version 1.6.4
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.4 | 49 | 8/16/2026 |
| 1.6.3 | 52 | 8/14/2026 |
| 1.6.2 | 46 | 8/13/2026 |
| 1.6.1 | 70 | 8/4/2026 |
| 1.6.0 | 72 | 7/31/2026 |
| 1.5.0 | 73 | 7/27/2026 |
| 1.4.25 | 75 | 7/17/2026 |
| 1.4.24 | 70 | 7/14/2026 |
| 1.4.23 | 88 | 7/12/2026 |
| 1.4.22 | 82 | 7/10/2026 |
| 1.4.21 | 74 | 7/9/2026 |
| 1.4.20 | 64 | 7/9/2026 |
| 1.4.19 | 77 | 7/9/2026 |
| 1.4.18 | 70 | 7/8/2026 |
| 1.4.17 | 76 | 7/7/2026 |
| 1.4.16 | 82 | 6/30/2026 |
| 1.4.15 | 84 | 6/25/2026 |
| 1.4.14 | 90 | 6/22/2026 |
| 1.4.13 | 86 | 6/21/2026 |
| 1.4.12 | 85 | 6/19/2026 |
### Fixes
- **A typed function returning `node()*` now yields text NODES for text its body produces.** A stylesheet function whose declared return type admits text (`node()*`, `text()*`, `item()*`) never enabled text-node collection for its body, so text produced inside — most often by the built-in rule copying a source text node — fell through to the output buffer and the result was handed back as a plain string. A caller declaring `as="node()*"` then received a String and raised `XTTE0780`. The typed `xsl:variable` seam had always done this correctly, so the two disagreed on identical bodies. Reported by Martin Honnen: XSpec's `x:resolve-import` is exactly this shape, and it was the single largest blocker in that compiler.
- **A typed attribute template no longer escapes a shallow copy.** A matched attribute template with a declared type (`as="attribute()"`) captures its own result and propagates it to whatever sequence accumulator is active; under the built-in shallow-copy rule that was the *enclosing* one, so the attribute escaped the element being copied and surfaced as a loose attribute node in the caller's sequence, with the element losing it. Later fatal where that sequence is dropped into an `xsl:document` (`XTDE0420`). The child half of shallow-copy already suspended the accumulator for this reason; the attribute half now does too. Surfaced via XSpec's `gather-specs.xsl`, where every `x:variable`/`x:param` shed its attributes.
- **A function body's output slice is now relative to its own base.** The simple-content flush (reached inside comment / PI / attribute content while text is collected as sequence items) sliced and cleared the whole output buffer. Inside a stylesheet function that buffer already holds the caller's content, so the flush stole it and left the buffer shorter than the offset the function had saved — producing `ArgumentOutOfRangeException: startIndex cannot be larger than length of string`, and before that a silently corrupted document (the caller's text pulled inside a constructed comment). Reported by Martin Honnen.
- **A node result now atomizes for an atomic function return type.** Per the function conversion rules an atomic declared return type atomizes its result before converting it, so returning an attribute or element where `xs:decimal` is declared is legal. The result assembly coerced text items but left XDM nodes alone, raising `XTTE0780: … requires type Decimal but got XdmAttribute`. XSpec's `x:xslt-version` is exactly this — `as="xs:decimal"` over an expression yielding an attribute node whenever a stylesheet declares its version — and clearing it took XSpec from 1 to 63 suites reaching execution.
### Internal
- **One shared construction context for every `as=`-typed body.** The seams behind `xsl:variable`, `xsl:param`, `xsl:with-param`, a parameter's default value and `xsl:function` each grew their own save/reset/restore block and had diverged; every capture bug above was a field one seam handled and another did not. They now share a single context covering the body's base offset, document-construction depth, text collection, text/attribute content depth, the collected-attribute stack and atomic spacing, so that class of divergence is no longer representable. Result assembly stays per-seam.
### Dependencies
- Requires **PhoenixmlDb.XQuery 1.6.2**, which carries the companion `fn:QName` and `fn:namespace-uri-for-prefix` fixes.