PhoenixmlDb.Xslt
1.6.12
See the version list below for details.
dotnet add package PhoenixmlDb.Xslt --version 1.6.12
NuGet\Install-Package PhoenixmlDb.Xslt -Version 1.6.12
<PackageReference Include="PhoenixmlDb.Xslt" Version="1.6.12" />
<PackageVersion Include="PhoenixmlDb.Xslt" Version="1.6.12" />
<PackageReference Include="PhoenixmlDb.Xslt" />
paket add PhoenixmlDb.Xslt --version 1.6.12
#r "nuget: PhoenixmlDb.Xslt, 1.6.12"
#:package PhoenixmlDb.Xslt@1.6.12
#addin nuget:?package=PhoenixmlDb.Xslt&version=1.6.12
#tool nuget:?package=PhoenixmlDb.Xslt&version=1.6.12
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 (>= 1.6.7)
- PhoenixmlDb.XQuery (>= 1.6.10)
-
net8.0
- PhoenixmlDb.Core (>= 1.6.7)
- PhoenixmlDb.XQuery (>= 1.6.10)
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 |
|---|---|---|
| 2.1.0 | 88 | 9/17/2026 |
| 2.0.0 | 142 | 9/15/2026 |
| 1.8.0 | 214 | 9/14/2026 |
| 1.7.0 | 106 | 9/11/2026 |
| 1.6.15 | 178 | 9/9/2026 |
| 1.6.14 | 125 | 9/7/2026 |
| 1.6.13 | 162 | 9/2/2026 |
| 1.6.12 | 126 | 8/30/2026 |
| 1.6.11 | 112 | 8/29/2026 |
| 1.6.10 | 177 | 8/27/2026 |
| 1.6.9 | 106 | 8/26/2026 |
| 1.6.8 | 105 | 8/26/2026 |
| 1.6.7 | 109 | 8/24/2026 |
| 1.6.6 | 116 | 8/23/2026 |
| 1.6.5 | 134 | 8/22/2026 |
| 1.6.4 | 135 | 8/16/2026 |
| 1.6.3 | 105 | 8/14/2026 |
| 1.6.2 | 106 | 8/13/2026 |
| 1.6.1 | 128 | 8/4/2026 |
| 1.6.0 | 124 | 7/31/2026 |
### A global variable nobody reads could fail the whole transform
Found while working through the XSpec suites, following the thread Martin Honnen started.
The engine primed a stylesheet by initializing every global variable eagerly, before running
anything. If a global's initializer needed a context item and there wasn't one, that error was
fatal. It stayed fatal even when nothing in the stylesheet ever read the variable.
The shape that bites in practice is a stylesheet invoked through a named template with no source
document, importing a module that happens to declare something like:
<xsl:variable name="initial-document" as="document-node()" select="/"/>
The importing stylesheet never touches that variable. Priming does, and the transform dies
before doing any work. That is exactly what XSpec generates, since its test stylesheet imports
the stylesheet under test and runs it through `x:main`.
XSLT 3.0 §2.3.2 addresses this case directly:
> It is implementation-defined whether this error occurs during priming of the stylesheet or
> subsequently when the variable is referenced; and it is implementation-defined whether the
> error occurs at all if the variable or parameter is never referenced.
So the old behaviour was a legal reading of the specification. It was not the reading Saxon
takes, and real stylesheets are written against that one. We now defer: a failing initializer is
captured rather than propagated, and the error is re-raised only if something actually reads the
variable.
Deferral covers dynamic errors only. Static errors and circularity still surface at priming,
where they belong.
Two smaller things fell out of the same work. The variable fallback used to rewrite a deferred
error into "variable not bound", which named the wrong problem entirely and sent you looking in
the wrong place. And a deferred global could reach the XQuery layer as an internal wrapper
rather than a value, surfacing as "context item is not a node". That leak was already latent in
the abstract-variable path.
Across the 284 XSpec suites, the number reaching completion went from 62 to 66, and the
`XPDY0002` bucket dropped from 6 suites to 1.
### The `xslt` tool could hang forever instead of doing anything
Two `xslt` processes were found alive at 0% CPU having produced no output at all. One had been
running for 21 hours, the other for three days and nineteen hours.
A managed stack showed both parked in a console read. When a named template is invoked with
`-it` and no source document is supplied, the tool still tried to read a source from standard
input. Under a terminal that looks like a freeze. Under a script, a CI job, or an agent harness
where standard input is an inherited pipe that never reaches end-of-file, it waits forever.
When `-it` names a template the transform starts from that template and needs no source, so
there was never anything to wait for. The tool no longer reads standard input in that case.
Piping a document to an invocation without `-it` works exactly as before.
If you have ever had the tool appear to hang in automation, this was why.