PhoenixmlDb.Xslt 1.6.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package PhoenixmlDb.Xslt --version 1.6.4
                    
NuGet\Install-Package PhoenixmlDb.Xslt -Version 1.6.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PhoenixmlDb.Xslt" Version="1.6.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PhoenixmlDb.Xslt" Version="1.6.4" />
                    
Directory.Packages.props
<PackageReference Include="PhoenixmlDb.Xslt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PhoenixmlDb.Xslt --version 1.6.4
                    
#r "nuget: PhoenixmlDb.Xslt, 1.6.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PhoenixmlDb.Xslt@1.6.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PhoenixmlDb.Xslt&version=1.6.4
                    
Install as a Cake Addin
#tool nuget:?package=PhoenixmlDb.Xslt&version=1.6.4
                    
Install as a Cake Tool

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 outputsxsl:result-document for 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.

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.6.9 0 8/26/2026
1.6.8 30 8/26/2026
1.6.7 54 8/24/2026
1.6.6 61 8/23/2026
1.6.5 82 8/22/2026
1.6.4 117 8/16/2026
1.6.3 88 8/14/2026
1.6.2 86 8/13/2026
1.6.1 106 8/4/2026
1.6.0 108 7/31/2026
1.5.0 127 7/27/2026
1.4.25 106 7/17/2026
1.4.24 88 7/14/2026
1.4.23 131 7/12/2026
1.4.22 107 7/10/2026
1.4.21 111 7/9/2026
1.4.20 103 7/9/2026
1.4.19 100 7/9/2026
1.4.18 101 7/8/2026
1.4.17 104 7/7/2026
Loading failed

### 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.