PhoenixmlDb.Xslt
3.1.0
See the version list below for details.
dotnet add package PhoenixmlDb.Xslt --version 3.1.0
NuGet\Install-Package PhoenixmlDb.Xslt -Version 3.1.0
<PackageReference Include="PhoenixmlDb.Xslt" Version="3.1.0" />
<PackageVersion Include="PhoenixmlDb.Xslt" Version="3.1.0" />
<PackageReference Include="PhoenixmlDb.Xslt" />
paket add PhoenixmlDb.Xslt --version 3.1.0
#r "nuget: PhoenixmlDb.Xslt, 3.1.0"
#:package PhoenixmlDb.Xslt@3.1.0
#addin nuget:?package=PhoenixmlDb.Xslt&version=3.1.0
#tool nuget:?package=PhoenixmlDb.Xslt&version=3.1.0
PhoenixmlDb.Xslt
XSLT 4.0 transformation engine for PhoenixmlDb — transform XML documents into HTML, JSON, CSV, text, or other XML formats.
Features
- XSLT 3.0/4.0 — template matching, streaming, accumulators, packages, maps/arrays
- All output methods — HTML5, XML, XHTML, JSON, text, CSV, adaptive
- Multiple outputs —
xsl:result-documentfor multi-file generation - Full XPath 4.0 — 240+ built-in functions available in all expressions
- Packages — reusable stylesheet libraries with visibility control
Quick example
using PhoenixmlDb.Xslt;
var transformer = new XsltTransformer();
await transformer.LoadStylesheetAsync(
File.ReadAllText("style.xsl"),
new Uri(Path.GetFullPath("style.xsl")));
transformer.SetParameter("title", "My Report");
var html = await transformer.TransformAsync(
File.ReadAllText("data.xml"));
// Handle secondary outputs (xsl:result-document)
foreach (var (href, content) in transformer.SecondaryResultDocuments)
File.WriteAllText(Path.Combine(outputDir, href), content);
See the full API overview in the README.
Related packages
| Package | Description |
|---|---|
| PhoenixmlDb.Core | Core types and XDM data model (dependency) |
| PhoenixmlDb.XQuery | XQuery 4.0 query engine (dependency) |
| PhoenixmlDb.Xslt.Cli | xslt command-line tool |
Documentation
Full documentation at phoenixml.dev
License
Apache 2.0
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
-
net10.0
- PhoenixmlDb.Core (>= 2.6.0)
- PhoenixmlDb.XQuery (>= 3.1.0)
-
net8.0
- PhoenixmlDb.Core (>= 2.6.0)
- PhoenixmlDb.XQuery (>= 3.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 3.2.0 | 244 | 11/18/2026 | |
| 3.1.0 | 294 | 11/13/2026 | |
| 3.0.0 | 212 | 11/4/2026 | |
| 2.9.0 | 457 | 10/15/2026 | |
| 2.8.0 | 219 | 10/9/2026 | |
| 2.7.0 | 148 | 10/7/2026 | |
| 2.6.0 | 154 | 10/6/2026 | |
| 2.5.1 | 229 | 10/1/2026 | |
| 2.4.1 | 370 | 9/28/2026 | |
| 2.4.0 | 138 | 9/28/2026 | |
| 2.2.0 | 157 | 9/25/2026 | |
| 2.1.0 | 217 | 9/17/2026 | |
| 2.0.0 | 199 | 9/15/2026 | |
| 1.8.0 | 295 | 9/14/2026 | |
| 1.7.0 | 174 | 9/11/2026 | |
| 1.6.15 | 259 | 9/9/2026 | |
| 1.6.14 | 239 | 9/7/2026 | |
| 1.6.13 | 204 | 9/2/2026 | |
| 1.6.12 | 156 | 8/30/2026 | |
| 1.6.11 | 152 | 8/29/2026 |
Requires PhoenixmlDb.XQuery 3.1.0 and PhoenixmlDb.Core 2.6.0. A limit on the length of built
strings, and streaming that holds memory flat for more stylesheets. W3C XSLT: 131 failing of
11,539, measured on a host in UTC (3.0.0: 132).
### New: a limit on the length of a built string
`XsltTransformOptions.MaxStringLength` and `XsltTransformer.MaxStringLength` (`int?`, default
`null`: no limit) set the longest string, in UTF-16 code units, that one operation may build. Over
the limit is `FOER0000`.
- XPath expressions apply it through `QueryExecutionLimits.MaxStringLength`: `concat`,
`string-join`, `||` and the other string builders.
- XSLT instructions that join values into one string apply it too: `xsl:value-of`, the content of
`xsl:attribute`, `xsl:comment`, `xsl:processing-instruction` and `xsl:namespace`, and attribute
and text value templates.
- `fn:transform` passes the limit to the transformation it starts, in both directions.
`MaxOutputSize` limits only the serialized result. A stylesheet, or a Schematron schema compiled to
one, can build a very large string from no input, faster than a time limit can cancel it. A host
that runs untrusted stylesheets sets both limits.
### New: `XsltTransformer.LastTransformStreamed`
A streamable stylesheet does not always stream: an entry at a named template or a function, and a
rule for the document node that the streaming pass cannot answer, read the input whole. The
read-only property tells whether the last transformation streamed. The `--timing` label of the
CLI comes from it.
### Streaming
- **The `TextReader` overloads stream** (#464): with a streamable initial mode, they read from the
reader as the `Stream` overloads do. The CLI writes standard output as the result is produced:
`sum(root/item)` over 4 million items uses 100 MiB (3.0.0: 331 MiB).
- **A streamed `xsl:source-document` with `use-accumulators="#all"` runs the accumulators.** In
3.0.0 the values on streamed elements were those of an empty tree, with no error.
- **`accumulator-after()` of the document node streams** (#461): after `xsl:apply-templates`, and
as the only read of the input. 3.0.0 read the input into a tree, about 1 GiB per million items.
- **A leading `/` in a rule for the document node is that node** (#468): in a `match="/"` rule,
`sum(/root/item)`, `sum(//item)` and `count(/root/item)` stream, about 100 MiB per million items
(3.0.0: about 800 MiB).
- **An aggregate over a value computed from each element streams** (#462).
- **With a caller's writer** (#472): `method="json"` output reaches the writer, and a source with
strict or lax validation is read whole and validated as a tree.
### Other behaviour
- **`fn:function-lookup` inside `xsl:evaluate` raises XTDE3160 for the XSLT-defined functions**, as
a direct call does (XSLT 3.0 §10.4.1; W3C evaluate-048). A `function-lookup#2` item made in the
stylesheet keeps the stylesheet's context.
- A failure deep in recursion returns quickly.
- The remarks of `TransformAsync` say that completing its task needs a free thread-pool thread.
### Repository
No package change: the conformance run measures the XSLT suite only (QT3 is measured in
phoenixmldb-xquery), and the tests wait with `Task.WaitAsync` (CA2027).